The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

App::mirai - debugging for Future-based code

VERSION

version 0.003

SYNOPSIS

# Just trace a single script to STDOUT/STDERR:
mirai-trace script.pl

# Run the Tickit interface, and have it load the script as a separate process, directing
# STDOUT/STDERR to windows in the UI and communicating via pipepair
mirai script.pl

# eventually, the following options may also be added:

# start an IO::Async::Listener on the given port/socket file. Means the event loop needs to
# be running, but should be able to hook into an existing application without too much trouble.
# Some complications around Future nesting (Futures are created by the debugger itself) but
# that's easy enough to work around
perl -d:Mirai=localhost:1234 script.pl
perl -d:Mirai=/tmp/mirai.sock script.pl

# Run Tickit interface directly, presuming that the code itself is silent - everything is
# in-process, so no need for debugging to go via pipes
perl -Mirai script.pl

DESCRIPTION

Provides a basic debugging interface for tracing and interacting with Futures. This should allow you to see the Future instances currently in use in a piece of code, and what their current status is.

The UI is currently Tickit-based.

Early preview screenshot:

Mirai Tickit user interface

There's a web interface in the works as well.

The name "mirai" (未来) was chosen because it's short and somewhat related to the concept of the code, plus it seemed like a better option than chigiri (契り) at the time.

SERIALISATION

Defines the serialisation format to use.

Prefers Sereal if available, will fall back to JSON via JSON::MaybeXS. Set MIRAI_SERIALISATION in the environment to override:

  • Sereal

  • JSON

METHODS

fork_child

Starts the child process for running the code-under-test.

SEE ALSO

AUTHOR

Tom Molesworth <cpan@perlsite.co.uk>

LICENSE

Copyright Tom Molesworth 2014-2015. Licensed under the same terms as Perl itself.