Carrot
view release on metacpan or search on metacpan
lib/Carrot/Continuity/Coordination/Episode./documentation/Episode-en.pod view on Meta::CPAN
my $loop = Carrot::Continuity::Coordination::Episode::Loop->constructor;
$loop->run(\$continue_flag); # await asynchronous events
To run the loop, call the method run. It takes one mandatory parameter, which is a scalar reference for loop control. As long as the scalar is true, the loop continues. However, the loop always completes the current round, there is no early break out...
=head1 Targets
An event is I<generated by a source> and I<delivered to a target>. If you set up a target, it will find its source automatically. Thus sources are not discussed at this point. Bringing a target to live is normally done in two steps. First the target ...
When an event occurs, a method of an object is called. It shouldn't be too surprising that Carrot::Continuity::Coordination::Episode I<delivers events to instances>. That is a considerable overhead compared to subroutine callbacks, however, it's prob...
Delivering events as method calls has the side effect of keeping references to instances. You are well advised to always deactivate your events after use, otherwise the referenced instance stays alive and receives events. To be on the safe side, you...
=head1 KNOWN BUGS AND LIMITATIONS
This is the first public release.
The Off-Topic directory OT contains some classes which might get replaced with a suitable solution from CPAN sooner or later.
=head1 AUTHOR
lib/Carrot/Continuity/Coordination/Episode/Target/FD_Nonstop_IO.pm view on Meta::CPAN
# /type method
# /effect "Constructs the attribute(s) of a newly created instance."
# //parameters
# that ::Personality::Abstract::Instance
# name
# file_handle
# //returns
{
my ($this, $that, $name, $file_handle) = @ARGUMENTS;
my $callbacks = [];
foreach my $default_name (@$default_names)
{
my $callback = $this->create_callback(
$that, $default_name, $name);
push($callbacks, $callback);
}
#FIXME: this is an assertion
my $type = Scalar::Util::blessed($file_handle);
unless ($type eq 'IO::Socket::INET')
{
$unsupported_file_class->raise_exception(
{+HKY_DEX_BACKTRACK => $file_handle,
'class' => $type},
ERROR_CATEGORY_SETUP);
}
@$this = ($that, $callbacks, $file_handle, IS_FALSE, fileno($file_handle));
return;
}
sub hit
# /type method
# /effect ""
# //parameters
# rwe
# //returns
# ?
{ # one out of four callbacks
return($_[THIS][ATR_CALLBACK][$_[SPX_RWE]]->($_[THIS][ATR_THAT], @ARGUMENTS));
}
sub validate_fh
# /type method
# /effect ""
# //parameters
# //returns
# ?
{
lib/Carrot/Modularity/Package/Event/Specific.pm view on Meta::CPAN
my $package_ids = $this->[ATR_IDS];
unless (exists($package_ids->{$pkg_name}))
{
$this->[ATR_COUNTER] += 1;
$package_ids->{$pkg_name} = $this->[ATR_COUNTER];
}
if (exists($this->[ATR_CALLBACKS]{$pkg_name}))
{
if (TRACE_FLAG)
{
print STDERR "Executing callbacks for package '$pkg_name'.\n";
}
my $callbacks = delete($this->[ATR_CALLBACKS]{$pkg_name});
foreach my $callback (@$callbacks)
{
$callback->($pkg_name);
}
}
if (exists($this->[ATR_UPGRADES]{$pkg_name}))
{
if (TRACE_FLAG)
{
print STDERR "Executing upgrades for package '$pkg_name'.\n";
}
lib/Carrot/Modularity/Package/Event/Specific.pm view on Meta::CPAN
if (TRACE_FLAG)
{
print STDERR "Request to callback for package '$pkg_name'.\n";
}
if (exists($this->[ATR_IDS]{$pkg_name}))
{
$callback->($pkg_name);
return;
}
my $callbacks = $this->[ATR_CALLBACKS];
unless (exists($callbacks->{$pkg_name}))
{
$callbacks->{$pkg_name} = [];
}
push($callbacks->{$pkg_name}, $callback);
return;
}
# =--------------------------------------------------------------------------= #
return(PERL_FILE_LOADED);
}
# //revision_control
# version 1.1.331
( run in 2.816 seconds using v1.01-cache-2.11-cpan-9b1e4054eb1 )