ZMQ::Declare::Device::Runtime - The runtime pitch on a ZMQ::Declare Device object
use ZMQ::Declare; ... see ZMQ::Declare and ZMQ::Declare::ZDCF ... my $runtime = $device->make_runtime; # or: $device->implementation(\&main_loop); $device->run; sub main_loop { my ($runtime) = @_; my $in_sock = $runtime->get_socket_by_name("listener"); my $out_sock = $runtime->get_socket_by_name("distributor"); while (...) {...} # actual main loop }
This object represents a full set of run-time 0MQ objects for a 0MQ device. It contains a 0MQ threading context and 0MQ sockets that are bound or connected to their endpoints.
Try not to share this across forks, see the nforks option to the run() method of a ZMQ::Declare::Device.
nforks
run()
ZMQ::Declare::Device
While there's a constructor, the typical way to obtain a runtime device object is to call the run() or make_runtime() methods on an abstract ZMQ::Declare::Device.
make_runtime()
Each ZMQ::Declare::Device::Runtime object holds a reference to its generating ZMQ::Declare::Device, its abstract, declare-time progenitor, so to speak.
ZMQ::Declare::Device::Runtime
The threading context for this runtime.
A hashref of socket names to ZeroMQ::Socket objects. See also: get_socket_by_name()
get_socket_by_name()
Constructor taking named parameters. See ZMQ::Declare::Device::run() and ZMQ::Declare::Device::make_runtime() instead.
ZMQ::Declare::Device::run()
ZMQ::Declare::Device::make_runtime()
Takes a socket name as first argument. Returns the socket of that name or throws and exception if it doesn't exist.
ZMQ::Declare, ZMQ::Declare::Device
ZeroMQ
Steffen Mueller <smueller@cpan.org>
Copyright (C) 2011,2012 by Steffen Mueller
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.1 or, at your option, any later version of Perl 5 you may have available.
To install ZMQ::Declare, copy and paste the appropriate command in to your terminal.
cpanm
cpanm ZMQ::Declare
CPAN shell
perl -MCPAN -e shell install ZMQ::Declare
For more information on module installation, please visit the detailed CPAN module installation guide.