AnyEvent-Task
view release on metacpan or search on metacpan
note that this may change to 0 in the future.
STARTING THE SERVER
Typically you will want to start the client and server as completely
separate processes as shown in the synopses.
Running the server and the client in the same process is technically
possible but is highly discouraged since the server will "fork()" when
the client demands a new worker process. In this case, all descriptors
in use by the client are duped into the worker process and the worker
ought to close these extra descriptors. Also, forking a busy client may
be memory-inefficient (and dangerous if it uses threads).
Since it's more of a bother than it's worth to run the server and the
client in the same process, there is an alternate server constructor,
"AnyEvent::Task::Server::fork_task_server" for when you'd like to fork a
dedicated server process. It can be passed the same arguments as the
regular "new" constructor:
## my ($keepalive_pipe, $server_pid) =
AnyEvent::Task::Server::fork_task_server(
lib/AnyEvent/Task.pm view on Meta::CPAN
The C<min_workers> argument determines how many "hot-standby" workers should be pre-forked when creating the client. The default is 2 though note that this may change to 0 in the future.
=head1 STARTING THE SERVER
Typically you will want to start the client and server as completely separate processes as shown in the synopses.
Running the server and the client in the same process is technically possible but is highly discouraged since the server will C<fork()> when the client demands a new worker process. In this case, all descriptors in use by the client are duped into th...
Since it's more of a bother than it's worth to run the server and the client in the same process, there is an alternate server constructor, C<AnyEvent::Task::Server::fork_task_server> for when you'd like to fork a dedicated server process. It can be ...
## my ($keepalive_pipe, $server_pid) =
AnyEvent::Task::Server::fork_task_server(
name => 'hello',
listen => ['unix/', '/tmp/anyevent-task.socket'],
interface => sub {
return "Hello from PID $$";
},
( run in 0.246 second using v1.01-cache-2.11-cpan-87723dcf8b7 )