Re: data from bus to publishing function

"Jason R. Coombs" <jaraco-aM/[email protected]> Mon, 16 Jan 2017 06:37:55 -0800 (PST)
Newsgroups gmane.comp.python.cherrypy
Message-ID <[email protected]>
Glad to hear you got it working.

I see more clearly now what it is you're trying to achieve. You want to 
publish events from one request and have them streamed on blocking 
connections on other requests (possibly multiple).

I think you'll run into issues with your current implementation over time 
because the 'subscribe' calls never get cleaned up. That is, the server 
will accumulate subscribers to the `cpu` event. You'd like to be able to 
unsubscribe from that event if the client were to disconnect.

Which I think leads to another issue where a call to pubcpu will never 
exit. I'm not aware of any mechanism by which the server could signal to 
that request handler when the remote connection has dropped, so I suspect 
each client that connects will consume a thread until the server runs out 
of threads (30 by default, IIRC).

But perhaps the biggest concern I would have is that of the global event. I 
don't believe a single event will trigger multiple threads, so you may 
still be stuck with only one client getting the event to publish the 
message. Have you tried connecting two separate connections to the pubcpu 
while it's working? My guess is you only see events coming through on one 
connection or the other for a particular event.

-- 
You received this message because you are subscribed to the Google Groups "cherrypy-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cherrypy-users+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/[email protected]
To post to this group, send email to cherrypy-users-/JYPxA39Uh5TLH3MbocFF+G/[email protected]
Visit this group at https://groups.google.com/group/cherrypy-users.
For more options, visit https://groups.google.com/d/optout.