Skip Menu |

This queue is for tickets about the POE-Component-PreforkDispatch CPAN distribution.

Report information
The Basics
Id: 45094
Status: resolved
Priority: 0/
Queue: POE-Component-PreforkDispatch

People
Owner: Nobody in particular
Requestors: perl [...] evancarroll.com
Cc:
AdminCc:

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



Subject: methods declared in wrong place in synopsis
In synopsis I see this POE::Session->create( inline_states => { _start => \&start, do_slow_task => \&task, do_slow_task_cb => \&task_cb, }, ); However, later in the docs it explains it the right way. The poe-call to perl sub map belongs in the create for POE::Component::PreforkDispatch POE::Component::PreforkDispatch->create( max_forks => 4, pre_fork => 2, methods => { do_slow_task => \&task, do_slow_task_cb => \&task_cb} );
Both ways are correct. You can either a) create a separate POE::Session and reference the state name with 'method' every time you call 'new_request' on the PreforkDispatch session (which is detailed in the synopsis and demoed in the t/1-test.t test), or b) pass a %methods hashref to the create call and name the method with 'method_name' you'd like to call in the 'new_request' call. The code supports both, and is documented in the POD. Eric On Thu Apr 16 18:12:02 2009, ECARROLL wrote: Show quoted text
> In synopsis I see this > POE::Session->create( > inline_states => { > _start => \&start, > do_slow_task => \&task, > do_slow_task_cb => \&task_cb, > }, > ); > > However, later in the docs it explains it the right way. The poe-call to > perl sub map belongs in the create for POE::Component::PreforkDispatch > > POE::Component::PreforkDispatch->create( > max_forks => 4, > pre_fork => 2, > methods => { do_slow_task => \&task, do_slow_task_cb => > \&task_cb} > );