IO-Lambda

 view release on metacpan or  search on metacpan

lib/IO/Lambda.pm  view on Meta::CPAN

Returns true if running within a C<catch> block.

=item call_again(@param)

To be called only from within a C<catch> block. Calls the normal
callback that would be called if the event wouldn't be cancelled.
C<@param> is passed to the callback.

=item throw(@error)

Terminates the current lambda, then propagates C<@error> to the immediate
caller lambdas. They will have a chance to catch the exception with C<catch>
later, and re-throw by calling C<throw> again. The default action is to
propagate the exception further.

When there are no caller lambdas, a C<sigthrow> callback is called ( analog:
die outside eval calls $SIG{__DIE__} ).

=item sigthrow($callback :: ($lambda, @error))

Retrieves and sets a callback that is invoked when C<throw> is called
on lambda that no lambdas wait for. By default, is empty. When invoked,
is passed the lambda, and parameters passed to C<throw>.

=item callers

Returns event records that watch for the lambda.

=item callees

Returns event records that corresponds to the lambdas this lambda watches.

=item backtrace

Returns a C<IO::Lambda::Backtrace> object that represents thread of events
which leads to the current lambda. See L<IO::Lambda::Backtrace> for more.

=back

=head1 MISCELLANEOUS

=head2 Included modules

=over

=item *

L<IO::Lambda::Backtrace> - debug chains of events

=item *

L<IO::Lambda::Signal> - POSIX signals.

=item *

L<IO::Lambda::Socket> - lambda versions of C<connect>, C<accept> etc.

=item *

L<IO::Lambda::HTTP> - implementation of HTTP and HTTPS protocols.  HTTPS
requires L<IO::Socket::SSL>, NTLM/Negotiate authentication requires
L<Authen::NTLM> modules (not marked as dependencies).

=item *

L<IO::Lambda::DNS> - asynchronous domain name resolver.

=item *

L<IO::Lambda::SNMP> - SNMP requests lambda style. Requires L<SNMP>.

=item * 

L<IO::Lambda::Thread> - run blocking code executed in another thread.
Requires perl version greater than 5.8.0, preferably 5.10.0,
built with threads.

=item *

L<IO::Lambda::Fork> - run blocking code executed in another
process context. Doesn't work on win32 for obvious reasons.

=item *

L<IO::Lambda::Message> - base class for message queues over existing
file handles.

=item *

L<IO::Lambda::DBI> - asynchronous DBI

=item *

L<IO::Lambda::Poll> - generic polling wrapper

=item *

L<IO::Lambda::Flock> - flock(2) wrapper

=item *

L<IO::Lambda::Mutex> - wait for a shared resource

=back

=head2 Debugging

Various sub-modules can be controlled with the single environment variable,
C<IO_LAMBDA_DEBUG>, which is treated as a comma-separated list of modules.
For example,

      env IO_LAMBDA_DEBUG=io=2,http perl script.pl

displays I/O debug messages from C<IO::Lambda> (with extra verbosity) and from
C<IO::Lambda::HTTP>. C<IO::Lambda> responds for the following keys:

=over

=item io

Prints debugging information about file and timeout asynchronous events.



( run in 2.470 seconds using v1.01-cache-2.11-cpan-39bf76dae61 )