Hi,

I'm looking at the implementation of the native websocket support. I see that 
mehod broadcastMessage of class AbstractWebSocketProcessor exports the thread
local variables before broadcasting the message. Why we need to do this? Why 
can't we use the current variables (session, request cycle, etc...)?

Three reasons:
1) In many cases they have to be set since the broadcast can be called from 
non-wicket and non-servlet code.
2) in many cases broadcasting is only deadlock safe through a queue and thread 
pool, in which case the threads will again not have any wicket threadlocals set
3) when you broadcast a message (for example from ajax request) it is often delivered to another session. when invoking component callbacks in another session it would be confusing (or even a security problem) for the called code to see the actual initiator session stuff

But I'm interested in hearing if you have a use case where having the original 
session, etc available for the event handlers would be useful?

-Mikko

Reply via email to