=head1 NAME NACL::Events::C_STask - Base branch event class for all events published by NACL component or STask method invocations =head1 DESCRIPTION C event class can be used for subscribing to all events published by NACL component and STask method invocations. This event class can be used only for subscribing not for publishing any events. This library extends the functionality of C =head1 SYNOPSIS The following example will illustrate on how to subscribe to all NACL events use NATE::Log qw(log_global); use NATE::Events qw(eventloop_drain); use NACL::Events::C_STask;; my $event = NACL::Events::C_STask->new(); # subscribe to all NACL events and execute the callback when it occurs my $listener = $event->subscribe(listener => { callback => \&event_handler, flag => 0 }); sub event_handler { my $msg_obj = shift; my $local_listener = shift; if ($msg_obj->topic() eq "NACL::Events::C_STask::Foo::create") { log_global()->comment("An element Foo was created"); } elsif ($msg_obj->topic() eq "NACL::Events::C_STask::Foo::delete") { log_global()->comment("An element Foo was deleted"); # update the flag on the listener hash reference to break the eventloop_drain $local_listener->{flag} = 1; } elsif { .. } .. } while (!$listener->{flag}) { # do other things in the mean time ... eventloop_drain(); } =cut package NACL::Events::C_STask; # inherit all methods from NACL::Events::Branch use parent qw(NACL::Events::Branch); 1;