So This bit... Can I use this in a separate thread? Would it be thread
safe? Would I have to bend the cometContext into a Publish Context? Or do
I use getCometHandlers and notify(attachment, CometHandler) to send the
message?
Or am I wrong, and that there is a different way I should be sending
messages in? I want to keep async for this....
I keep reading the "documentation" hopeing a light goes off.
final String channel = context.getChannel();
final Set<DataHandler> handlers =
context.lookupClientHandlers(channel);
final CometContext cometContext =
CometEngine.getEngine().getCometContext(channel);
final DataHandler sender = context.getSenderClient();
/// Send message to all clients except the sender
for (DataHandler dataHandler : handlers) {
try {
cometContext.notify(patternResponse,
dataHandler);
}
} catch (IOException ex) {
Logger.getLogger(CometServer.class.getName()).log(Level.SEVERE, null, ex);
}
}
}
});
--
View this message in context: http://old.nabble.com/Am-I-crazy--Yes...--%28I-think-I-know-more%2C-so-will-re-ask%29-tp27475268p27516722.html
Sent from the Grizzly - Users mailing list archive at Nabble.com.