App-MultiModule

 view release on metacpan or  search on metacpan

lib/App/MultiModule/Core.pm  view on Meta::CPAN

    $kernel->alias_remove($heap->{alias}) if $heap->{alias};
    $kernel->alarm_remove_all();
    $kernel->refcount_decrement($session, 'my ref name');
    $kernel->post($heap->{child_session}, 'shutdown') if $heap->{child_session};

    return;
}

=head2 named_recur(%args)

This is the preferred method to schedule recurring code in this framework.
Typically called from within set_config(), it automatically ensures
that only a single POE recurring event is setup, no matter how many times
named_recur() is called.

Simply put: if your tasks has code that needs to run on an interval,
use this method to schedule it.

The value in the 'recur_name' argument is used by this method to guard
against unwanted redundant scheduling of a code reference.

lib/App/MultiModule/Core.pm  view on Meta::CPAN

    my $is_multimodule = $has_message_method;
    return {
        is_stateful => $is_stateful,
        is_multimodule => $is_multimodule,
    };
};

=head2 get_multimodules_info

This returns a hash reference that contains information about every
task that the MultiModule framework is aware of.  'aware of' is not
limited to running and/or loaded.  A MultiModule task module that
exists in the configured search path, even though it is not referenced
or configured, will also be in this structure.

The key to the return hash is the task name.  The value is a reference
to a hash that contains a variety of fields:

=over 4

=item is_multimodule

lib/App/MultiModule/Tutorial.pod  view on Meta::CPAN

                ct => $self->{state}->{ct}++,
                    #increment the counter in the saved state, and
                    #put that into the 'ct' field of the message.

                outstr => $config->{outstr},
                    #simply pass in the configured 'output' string.
            };
            $self->emit($message);
                #key point!
                #Tasks do not send messages to other tasks.  They simply
                #emit() messages to the MultiModule framework.  Separate
                #config to the Router task is fully responsible for how
                #messages flow.
        },
    );
 }

 #tasks default to not stateful; in order to become stateful, just
 #make the is_stateful() method return some kind of true thing
 sub is_stateful {
    return 'yes!';



( run in 0.733 second using v1.01-cache-2.11-cpan-df04353d9ac )