Hi Paul,
> So This bit... Can I use this in a separate thread?
Yes.
> Would it be thread safe?
Should be :)
> Would I have to bend the cometContext into a Publish Context?
CometContext is a static resource, so no need to save it somewhere.
You can always get it by CometEngine.getContext(channel);
> 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....
For now cometContext.notify(...) is the right way to send message to a
client. You can call it async.
WBR,
Alexey.
>
> 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.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_grizzly.dev.java.net
> For additional commands, e-mail: users-help_at_grizzly.dev.java.net
>