NAME

Ambrosia::Event - lets you publish and subscribe to events.

VERSION

version 0.010

SYNOPSIS

    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();

DESCRIPTION

Ambrosia::Event lets you publish and subscribe to events.

METHODS

publicEvent $name, $params

Fire named ($name) event and passes a $params ($params is optional).

THREADS

Not tested.

BUGS

Please report bugs relevant to Ambrosia to <knm[at]cpan.org>.

COPYRIGHT AND LICENSE

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.

AUTHOR

Nikolay Kuritsyn (knm[at]cpan.org)