POEx::ZMQ3::Role::Emitter - Event emitter for POEx::ZMQ3::Sockets
Primarily used internally; the following public methods are provided to consumers:
$component->add_bind( $alias, $endpoint ); $component->add_connect( $alias, $endpoint ); my @bound = $component->list_binds; my @connects = $component->list_connects; $component->close_socket( $alias ); my $backend = $component->zmq;
This is a small wrapper for MooX::Role::POE::Emitter, providing some default attributes and sane defaults for a POEx::ZMQ3::Sockets-based Emitter:
The Emitter's event_prefix is 'zeromq_' 'PROCESS' type events (->process) have the Pluggable prefix 'P_Zmq' 'NOTIFY' type events (->emit) have the Pluggable prefix 'Zmq'
A POEx::ZMQ3::Sockets instance is automatically created if not provided; see "zmq".
Some frontend methods for managing connections on a socket are provided. See below.
Takes no arguments.
Returns the current POEx::ZMQ3::Sockets instance.
Takes a POEx::ZMQ3::Sockets socket alias and an endpoint to bind.
Takes an optional socket alias.
Returns a list of currently-tracked bound endpoints for the socket.
If no alias is specified, returns all currently-tracked aliases with bound endpoints.
Takes a socket alias and an endpoint to connect to.
Takes the same arguments as "list_binds", but lists connect-type endpoints instead.
Takes a socket alias.
Closes and stops tracking the specified socket.
(This happens automatically when 'stop' is called.)
A consumer session should override build_defined_states to return an ARRAY suitable for feeding to "object_states" in MooX::Role::POE::Emitter:
sub build_defined_states { my ($self) = @_; [ $self => [ qw/ emitter_started zmqsock_recv / ], ] }
Jon Portnoy <avenj@cobaltirc.org>
To install POEx::ZMQ3, copy and paste the appropriate command in to your terminal.
cpanm
cpanm POEx::ZMQ3
CPAN shell
perl -MCPAN -e shell install POEx::ZMQ3
For more information on module installation, please visit the detailed CPAN module installation guide.