Net::Async::Blockchain::Client::ZMQ - Async ZMQ Client.
my $loop = IO::Async::Loop->new(); $loop->add(my $zmq_source = Ryu::Async->new); $loop->add( my $zmq_client = Net::Async::Blockchain::Client::ZMQ->new( endpoint => 'tpc://127.0.0.1:28332', )); $zmq_client->subscribe('hashblock')->each(sub{print shift->{hash}})->get;
client for the bitcoin ZMQ server
Create an Ryu::Source instance, if it is already defined just return the object
Ryu::Source
TCP ZMQ endpoint
URL containing the port if needed, in case of DNS this will be resolved to an IP.
Timeout time for connection
Integer time in seconds
Timeout time for received messages, this is applied when we have a bigger duration interval between the messages.
ZMQ socket
return the socket for ZMQ ZMQ::LibZMQ3
Any additional configuration that is not described on IO::Async::Notifier must be included and removed here.
If this class receive a DNS as endpoint this will be resolved on this method to an IP address.
endpoint
timeout connection timeout (seconds)
timeout
msg_timeout msg interval timetout (seconds)
msg_timeout
Connect to the ZMQ server and start the subscription
subscription subscription string name
subscription
Since each response is partial we need to join them
Multipart response array
run the configured shutdown action if any
error error message
error
add_child, adopt_future, adopted_futures, can_event, children, configure_unknown, debug_printf, get_loop, invoke_error, invoke_event, loop, make_event_cb, maybe_invoke_event, maybe_make_event_cb, new, notifier_name, parent, remove_child, remove_from_parent
To install Net::Async::Blockchain, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::Async::Blockchain
CPAN shell
perl -MCPAN -e shell install Net::Async::Blockchain
For more information on module installation, please visit the detailed CPAN module installation guide.