Skip Menu |
 

This queue is for tickets about the POE CPAN distribution.

Report information
The Basics
Id: 1727
Status: rejected
Priority: 0/
Queue: POE

People
Owner: RCAPUTO [...] cpan.org
Requestors: RCAPUTO [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Unimportant
Broken in: (no value)
Fixed in: (no value)



Subject: replace session references with IDs as internal keys
Download (untitled) / with headers
text/plain 1.3k
Currently POE::Kernel's data structures are keyed on a session's reference. POE reuses references often, so new sessions may have the same keys as dead ones. This becomes a problem if we want to delay the cleanup of resources from dead sessions. Consider events in the queue that are destined for SESSION_REF, which has stopped. It's possible for a new session to be created with the same SESSION_REF before the events are dispatched. Those events would then be sent to the new SESSION_REF, which isn't what we want. To solve the meta-problem, we can use session IDs instead of references as the keys into POE::Kernel's data structures. These IDs are unique, and it can be guaranteed that they never clash. Things to do: Most of the public POE::Kernel methods already call the internal _resolve_session() method, which returns a session reference for whatever was passed to the function. It can be made to return a session ID instead, solving a lot of this task. _dispatch_event() currently passes the destination session to the session's _invoke_state() method, but that's not needed. I think the session will know its $self and can use that instead. So... we can qknow which ID to use in the Kernel methods that are called, and we can provide the $_[SESSION] back to each session. What remains is to re-key the data structures on session IDs and to provide IDs instead of session references to their accessors.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.