Created
June 4, 2011 04:05
-
-
Save colin-haber/1007565 to your computer and use it in GitHub Desktop.
blocking problems
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private void initPrinter() { | |
| new Thread(new Runnable() { public void run() {while (true) { | |
| Message read = messageQueue.read(); | |
| String text = read.getText(); | |
| //process and print | |
| } catch (Exception e) { | |
| e.printStackTrace(); | |
| } | |
| }}}).start(); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public Message read() { | |
| try { | |
| return (Message) in.readObject(); | |
| } catch (Exception e) { | |
| e.printStackTrace(); | |
| } | |
| return null; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment