Why not adopt me?
This distribution is up for adoption!
If you're interested then please contact the PAUSE module admins via
email.
NAME
POEx::ZMQ3::Role::Emitter - Event emitter for POEx::ZMQ3
SYNOPSIS
package MyZMQServer;
use Moo;
with 'POEx::ZMQ3::Role::Emitter';
with 'POEx::ZMQ3::Role::Sockets';
sub start {
my ($self) = @_;
# ... set up zeromq connections, etc ...
$self->_start_emitter;
}
sub stop {
my ($self) = @_;
$self->process( 'stop' );
## -> dispatched to loaded plugins as Zmq_stop
$self->clear_all_zmq_sockets;
$self->_shutdown_emitter;
}
sub zmq_message_ready {
my ($self, $alias, $zmsg, $data) = @_;
$self->emit( 'got_msg', $data );
# -> dispatched to loaded plugins as Zmq_got_msg
# (synchronously)
# -> emitted to subscribed POE::Session(s) as zeromq_got_msg
# (async)
}
DESCRIPTION
This is a small wrapper for MooX::Role::POE::Emitter, providing some sane defaults for a POEx::ZMQ3 Emitter:
->event_prefix eq 'zeromq_'
->pluggable_type_prefixes eq +{
PROCESS => 'P_Zmq',
NOTIFY => 'Zmq',
}
AUTHOR
Jon Portnoy <avenj@cobaltirc.org>