Acme-FSM

 view release on metacpan or  search on metacpan

t/process/filter.t  view on Meta::CPAN


my %plug =
( state      =>       q|STOP|,
  action     =>       q|DONE|,
  diag_level =>             1,
  namespace  =>         undef,
  source     => $opts{source},
  dumper     =>         undef );

my %tunits =
# TODO:201302161629:whynot: Move that stuff to YAML and {DATA}
( q|{filter-first-with-states}| =>
 [{                                             %common,
    S0 =>
    { switch => sub { push @{$_[0]->{queue}}, $_[1] },
      eturn  => [qw|                     STOP DONE |],
      tturn  => [qw|                       S1 NEXT |] },
    S1 =>
    { switch =>     \&consume_one,
      eturn  => [qw| STOP DONE |],
      tturn  => [qw|   S1 NEXT |]                     }                 },



( run in 0.941 second using v1.01-cache-2.11-cpan-cdf2f3d4e48 )