-
-
30 Jun 2019 08:19:09 UTC
- Distribution: IO-Lambda
- Source (raw)
- Browse (raw)
- Changes
- How to Contribute
- Repository
- Issues (0)
- Testers (562 / 103 / 0)
- Kwalitee
Bus factor: 1- % Coverage
- License: perl_5
- Activity
24 month- Tools
- Download (90.24KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
- Dependencies
- LWP
- Net::DNS
- Scalar::Util
- Storable
- Sub::Name
- Time::HiRes
- URI
- and possibly others
- Reverse dependencies
- CPAN Testers List
- Dependency graph
NAME
IO::Lambda::Backtrace - backtrace chains of events
DESCRIPTION
The module makes it easier to debug chains of events, when a lambda awaits for another, this one in turn for another, etc etc. The class
IO::Lambda::Backtrace
represents a set of such stacks, because a lambda can be awaited by more than one lambda. Each stack is an array of items where each contains the caller lambda and the invocation point. The class provides helper methods for printing this information in readable form.The module relies on the debug information about invocation points collected by
IO::Lambda
. By default, there's very little information collected, so in order to increase verbosity useIO::Lambda::DEBUG_CALLER
flag, either directly or through$ENV{IO_LAMBDA_DEBUG} = 'caller'
. If the flag is set to 1, lambdas collect invocation points. If the flag is set to 2, then also the additional perl stack trace is added.SYNOPSIS
use IO::Lambda; $IO::Lambda::DEBUG_CALLER = 1; lambda { ... warn this-> backtrace-> as_text; }
or from command line
env IO_LAMBDA_DEBUG=caller=2 ./myscript
API
- new($lambda)
-
Extracts the information of the current chain of events and creates a new blessed reference of it.
- as_text
-
Returns the backtrace information formatted as text, ready to display
- cluck
-
Warns with the backtrace log
- confess
-
Dies with the backtrace log
AUTHOR
Dmitry Karasik, <dmitry@karasik.eu.org>.
The ideas of backtracing threads of events, and implementing backtrace objects passable through execition stack are proposed by Ben Tilly.
Module Install Instructions
To install IO::Lambda, copy and paste the appropriate command in to your terminal.
cpanm IO::Lambda
perl -MCPAN -e shell install IO::Lambda
For more information on module installation, please visit the detailed CPAN module installation guide.