Skip to content

Instantly share code, notes, and snippets.

@JoelPM
Created February 5, 2014 07:16
public class MessageReceiver extends ConnectionRequiredRunnable {
private final MessageService.Processor processor;
private final TProtocol protocol;
public MessageReceiver(
TProtocol protocol,
MessageService.Iface messageService,
ConnectionStatusMonitor connectionMonitor) {
super(connectionMonitor, "Message Receiver");
this.protocol = protocol;
this.processor = new MessageService.Processor(messageService);
}
@Override
public void run() {
connectWait();
while (true) {
try {
while (processor.process(protocol, protocol) == true) { }
} catch (TException e) {
disconnected();
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment