AnyEvent-JSONRPC
view release on metacpan or search on metacpan
lib/AnyEvent/JSONRPC/HTTP/Client.pm view on Meta::CPAN
__PACKAGE__->meta->make_immutable;
__END__
=encoding utf-8
=begin stopwords
AnyEvent Coro JSONRPC Hostname Str HTTP HTTP-based
blockingly condvar condvars coroutine unix
=end stopwords
=head1 NAME
AnyEvent::JSONRPC::HTTP::Client - Simple HTTP-based JSONRPC client
=head1 SYNOPSIS
use AnyEvent::JSONRPC::HTTP::Client;
lib/AnyEvent/JSONRPC/HTTP/Client.pm view on Meta::CPAN
=over 4
=item Either you're in a main program,
Main programs are "allowed to call C<recv> blockingly", according to the
author of L<AnyEvent>.
=item or you're in a Coro + AnyEvent environment.
When you call C<recv> inside a coroutine, only that coroutine is blocked
while other coroutines remain active. Thus, the program as a whole is
still responsive.
=back
If you're not using Coro, and you don't want your whole program to block,
what you should do is call C<cb> on the condvar, and give it a coderef to
execute when the results come back. The coderef will be given a condvar
as a parameter, and it can call C<recv> on it to get the data. The final
example in the SYNOPSIS gives a brief example of this.
lib/AnyEvent/JSONRPC/TCP/Client.pm view on Meta::CPAN
__PACKAGE__->meta->make_immutable;
__END__
=encoding utf-8
=begin stopwords
AnyEvent Coro JSONRPC Hostname Str TCP TCP-based
blockingly condvar condvars coroutine unix
=end stopwords
=head1 NAME
AnyEvent::JSONRPC::TCP::Client - Simple TCP-based JSONRPC client
=head1 SYNOPSIS
use AnyEvent::JSONRPC::TCP::Client;
lib/AnyEvent/JSONRPC/TCP/Client.pm view on Meta::CPAN
=over 4
=item Either you're in a main program,
Main programs are "allowed to call C<recv> blockingly", according to the
author of L<AnyEvent>.
=item or you're in a Coro + AnyEvent environment.
When you call C<recv> inside a coroutine, only that coroutine is blocked
while other coroutines remain active. Thus, the program as a whole is
still responsive.
=back
If you're not using Coro, and you don't want your whole program to block,
what you should do is call C<cb> on the condvar, and give it a coderef to
execute when the results come back. The coderef will be given a condvar
as a parameter, and it can call C<recv> on it to get the data. The final
example in the SYNOPSIS gives a brief example of this.
( run in 0.235 second using v1.01-cache-2.11-cpan-87723dcf8b7 )