Net::Async::Blockchain::Client::Websocket - Async websocket Client.
my $loop = IO::Async::Loop->new(); $loop->add(my $ws_source = Ryu::Async->new()); $loop->add( my $client = Net::Async::Blockchain::Client::Websocket->new( endpoint => "ws://127.0.0.1:8546", ) ); $client->eth_subscribe('newHeads')->each(sub {print shift->{hash}})->get;
Auto load the commands as the method parameters for the websocket calls returning them asynchronously.
Create an Ryu::Source instance, if it is already defined just return the object
Ryu::Source
Websocket endpoint
URL containing the port if needed
Latest subscription sent from this module
Create an Net::Async::WebSocket::Client instance, if it is already defined just return the object
Net::Async::WebSocket::Client
Any additional configuration that is not described on IO::Async::Notifier must be included and removed here.
endpoint
Prepare the data to be sent to the websocket and call the request
method
@_ - any parameter required by the RPC call
@_
run the configured shutdown action if any
error error message
error
Subscribe to an event
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.