=encoding utf8

=for comment POD_DERIVED_INDEX_GENERATED
The following documentation is automatically generated.  Please do not edit
this file, but rather the original, inline with Net::Async::Blockchain::Client::ZMQ
at lib/Net/Async/Blockchain/Client/ZMQ.pm
(on the system that originally ran this).
If you do edit this file, and don't want your changes to be removed, make
sure you change the first line.

=cut

=head1 NAME

Net::Async::Blockchain::Client::ZMQ - Async ZMQ Client.

=head1 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;

=head1 DESCRIPTION

client for the bitcoin ZMQ server

=over 4

=back

=head2 source

Create an L<Ryu::Source> instance, if it is already defined just return
the object

=over 4

=back

L<Ryu::Source>

=head2 endpoint

TCP ZMQ endpoint

=over 4

=back

URL containing the port if needed, in case of DNS this will
be resolved to an IP.

=head2 timeout

Timeout time for connection

=over 4

=back

Integer time in seconds

=head2 msg_timeout

Timeout time for received messages, this is applied when we have a bigger
duration interval between the messages.

=over 4

=back

Integer time in seconds

=head2 socket_client

ZMQ socket

=over 4

=back

return the socket for ZMQ L<ZMQ::LibZMQ3>

=head2 configure

Any additional configuration that is not described on L<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.

=over 4

=item * C<endpoint>

=item * C<timeout> connection timeout (seconds)

=item * C<msg_timeout> msg interval timetout (seconds)

=back

=head2 subscribe

Connect to the ZMQ server and start the subscription

=over 4

=item * C<subscription> subscription string name

=back

L<Ryu::Source>

=head2 _recv_multipart

Since each response is partial we need to join them

=over 4

=item * C<subscription> subscription string name

=back

Multipart response array

=head2 shutdown

run the configured shutdown action if any

=over 4

=item * C<error> error message

=back

=head1 INHERITED METHODS

=over 4

=item L<IO::Async::Notifier>

L<add_child|IO::Async::Notifier/add_child>, L<adopt_future|IO::Async::Notifier/adopt_future>, L<adopted_futures|IO::Async::Notifier/adopted_futures>, L<can_event|IO::Async::Notifier/can_event>, L<children|IO::Async::Notifier/children>, L<configure_unknown|IO::Async::Notifier/configure_unknown>, L<debug_printf|IO::Async::Notifier/debug_printf>, L<get_loop|IO::Async::Notifier/get_loop>, L<invoke_error|IO::Async::Notifier/invoke_error>, L<invoke_event|IO::Async::Notifier/invoke_event>, L<loop|IO::Async::Notifier/loop>, L<make_event_cb|IO::Async::Notifier/make_event_cb>, L<maybe_invoke_event|IO::Async::Notifier/maybe_invoke_event>, L<maybe_make_event_cb|IO::Async::Notifier/maybe_make_event_cb>, L<new|IO::Async::Notifier/new>, L<notifier_name|IO::Async::Notifier/notifier_name>, L<parent|IO::Async::Notifier/parent>, L<remove_child|IO::Async::Notifier/remove_child>, L<remove_from_parent|IO::Async::Notifier/remove_from_parent>

=back

