NAME
Net::Async::Blockchain::Client::ZMQ - Async ZMQ Client.
SYNOPSIS
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;
DESCRIPTION
client for the bitcoin ZMQ server
source
Create an Ryu::Source instance, if it is already defined just return the object
endpoint
TCP ZMQ endpoint
URL containing the port if needed, in case of DNS this will be resolved to an IP.
timeout
Timeout time for connection
Integer time in seconds
msg_timeout
Timeout time for received messages, this is applied when we have a bigger duration interval between the messages.
Integer time in seconds
socket_client
ZMQ socket
return the socket for ZMQ ZMQ::LibZMQ3
configure
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)msg_timeout
msg interval timetout (seconds)
subscribe
Connect to the ZMQ server and start the subscription
subscription
subscription string name
_recv_multipart
Since each response is partial we need to join them
subscription
subscription string name
Multipart response array
shutdown
run the configured shutdown action if any
error
error message