Ambrosia::Event - lets you publish and subscribe to events.
version 0.010
package Foo; use Ambrosia::Event qw/on_start on_complete/; use Ambrosia::Meta; class sealed { }; sub run { my $self = shift; $self->publicEvent( 'on_start' ); ......... $self->publicEvent( on_complete => $eny_params ); } 1;
and other module.
$foo = Foo ->new() ->on_start(sub { print "Foo start\n" } ) ->on_complete(sub { print "Foo complete: @_\n" } ); $foo->run();
Ambrosia::Event lets you publish and subscribe to events.
Ambrosia::Event
Fire named ($name) event and passes a $params ($params is optional).
Not tested.
Please report bugs relevant to Ambrosia to <knm[at]cpan.org>.
Ambrosia
Copyright (C) 2010-2012 Nickolay Kuritsyn. All rights reserved.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Nikolay Kuritsyn (knm[at]cpan.org)
To install Ambrosia, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Ambrosia
CPAN shell
perl -MCPAN -e shell install Ambrosia
For more information on module installation, please visit the detailed CPAN module installation guide.