NAME
stubby - commandline tool for dumping stub Perl programs sequentialized using Sub::Genius.
EXPERIMENTAL, subject to wild swings in options and behaviors.
SYNOPSIS
$ stubby init [--run [once|any|all|nodeps]] [-s|--subroutines = "sub1 sub2 sub3 ..."] [-p|--preplan = "an & actual (PRE) ..."]
$ stubby precache [-f preplan.dat|--preplan = 'PRE...'] [-d path/to/cachedir] # NOT YET IMPLEMENTED
Example,
with use Sub::Genius ();
:
$ stubby init --run once -s "init spawn threadsA criticalsectA threadsB criticalsectB combine" > ./spawn-combine.pl
without Sub::Genius
:
$ stubby init --run nodeps -p "init ( threadA & threadB & threadC ) criticalSection ( threadA & threadB & threadC ) finalize" > ./spawn-combine.pl
cache only (for precompiling DFAs) NOT YET IMPLEMENTED
$ stubby precache -p "init ( threadA & threadB & threadC ) criticalSection ( threadA & threadB & threadC ) finalize" # NOT YET IMPLEMENTED
$ stubby precache -f ./my-preplan.dat -d put/in/here # NOT YET IMPLEMENTED
DESCRIPTION
Commandline tool for generating boilerplate for use with Sub::Genius.
Leverages the caching effects of Sub::Genius (see that POD for more information).
General Development Workflow
Most will want to use this to start their Perl script or module, the workflow over the lifetime of the program might look like this:
Dump program using
stubby
.Annotate PRE (
$pre
in generated code) to achieve concurrent semantics (see Sub::Genius for more info).Implement subroutine bodies that exist, albeit empty of anything meaningful.
...
Profit!
Maintain as any other code in your arsenal.
OPTIONS
init
-
Subcommand, currently only one supported.
-R|--run
-
Choose invocation method to use in the code. The default is
once
.Options include:
once
- generates code that invokesSub::Genius::run_once
; requires-s|--subroutine
any
- generates code that invokesSub::Genius::run_any
; requires-s|--subroutine
all
- generates code that invokesSub::Genius::run_once
, in ado { ... } while ()
loop; requires-s|--subroutine
nodeps
- generates code that is free of any dependencies, includingSub::Genius
; requires-p|--preplan
-s|--subroutines
-
Specify a space delimited list of subroutine names to generate stubs and a unannotated PRE.
Command fails if provided any values other than words and spaces (to prevent misinterpretation of PRE - may change).
-p|--preplan
-
An actual PRE, used with
--run nodeps
.
SEE ALSO
BUGS
Probably
COPYRIGHT AND LICENSE
perl5
AUTHOR
OODLER 577 <oodler@cpan.org>