view release on metacpan or search on metacpan
lib/CPANPLUS/Internals/Source/MetaCPAN/HTTP.pm view on Meta::CPAN
$res = $http->request($url, \&savetofile, OUT);
close OUT;
=item set_callback ( $functionref, $dataref )
At various stages of the request, callbacks may be used to modify the
behaviour or to monitor the status of the request. These work like the
$data_callback parameter to request(), but are more verstaile. Using
set_callback disables $data_callback in request()
The callbacks are called as:
callback ( $self, $phase, $dataref, $cbargs )
The current phases are:
connect - connection has been established and headers are being
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CPANPLUS/Shell/Tk.pm view on Meta::CPAN
sub _setup_contents {
my $self = shift;
my $MW = $self->{MW};
my $CP = $self->{CP};
$self->_setup_cpanplus_callbacks;
my ($topframe, $leftframe, $rightframe) = $self->_setup_frames;
$self->_setup_perl_info($topframe);
$self->_setup_left_frame($leftframe);
$self->_setup_right_frame($rightframe);
}
#------------------------------------------------------------------------
# _setup_cpanplus_callbacks installs callbacks in the Backend to recieve
# print and error messages and put them into the right frame
#
sub _setup_cpanplus_callbacks {
my $self = shift;
my $MW = $self->{MW};
my $CP = $self->{CP};
my $eo = $CP->error_object;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CPANPLUS/Dist/YACSmoke.pm view on Meta::CPAN
=over
=item C<init>
This method is called just after the new dist object is set up. It initialises the database file if it hasn't been initialised already
and loads the list of excluded distributions from the C<ini> file if that hasn't been loaded already. It also registers callbacks with
the L<CPANPLUS> backend.
=item C<prepare>
This runs the preparation step of your distribution. This step is meant to set up the environment so the create step can create the actual distribution(file).
view all matches for this distribution
view release on metacpan or search on metacpan
methods to CPS::Future
* Allow future chaining for cancellation
0.16 CHANGES:
* Allow passing CPS::Future objects into others for on_ready, on_done
and on_fail callbacks (RT78432)
* Override calling on a CPS::Future to invoke ->done directly
0.15 CHANGES:
* More work on CPS::Future - added ->and_then, ->transform
view all matches for this distribution
view release on metacpan or search on metacpan
Debian_CPANTS.txt view on Meta::CPAN
"libmarc-crosswalk-dublincore-perl", "MARC-Crosswalk-DublinCore", "0.02", "0", "0"
"libmarc-lint-perl", "MARC-Lint", "1.44", "0", "0"
"libmarc-perl", "MARC", "1.07", "0", "0"
"libmarc-record-perl", "MARC-Record", "2.0.0", "0", "0"
"libmarc-xml-perl", "MARC-XML", "0.92", "0", "0"
"libmasonx-interp-withcallbacks-perl", "MasonX-Interp-WithCallbacks", "1.18", "0", "0"
"libmath-algebra-symbols-perl", "Math-Algebra-Symbols", "1.21", "0", "0"
"libmath-basecalc-perl", "Math-BaseCalc", "1.013", "0", "0"
"libmath-basecnv-perl", "Math-BaseCnv", "1.4.75O6Pbr", "0", "0"
"libmath-bigint-gmp-perl", "Math-BigInt-GMP", "1.24", "1", "0"
"libmath-calc-units-perl", "Math-Calc-Units", "1.07", "0", "0"
view all matches for this distribution
view release on metacpan or search on metacpan
# we have selectors
elsif (my $sel_list = $sac->parse_selector_list(\$css)) {
warn "[SAC] parsed selectors\n" if DEBUG;
next unless @$sel_list;
# callbacks
$sac->[_dh_]->start_selector($sel_list) if $sac->[_dh_can_]->{start_selector};
# parse the rule
my $rule;
warn "[SAC] parsing rule\n" if DEBUG;
Methods will be called on whatever it is you pass as values to those
options. Thus, you may pass in objects as well as class names (I
haven't tested this yet, there may be a problem).
NOTE: an error handler should implement all callbacks, while a document
handler may only implement those it is interested in. There is a default
error handler (which dies and warns depending on the type of error) but
not default document handler.
=item * $sac->ParserVerion or $sac->getParserVerion
view all matches for this distribution
view release on metacpan or search on metacpan
libsass/sass_functions.cpp view on Meta::CPAN
cb->function = function;
cb->cookie = cookie;
return cb;
}
// Setters and getters for callbacks on function lists
Sass_Function_Entry ADDCALL sass_function_get_list_entry(Sass_Function_List list, size_t pos) { return list[pos]; }
void sass_function_set_list_entry(Sass_Function_List list, size_t pos, Sass_Function_Entry cb) { list[pos] = cb; }
const char* ADDCALL sass_function_get_signature(Sass_Function_Entry cb) { return cb->signature; }
Sass_Function_Fn ADDCALL sass_function_get_function(Sass_Function_Entry cb) { return cb->function; }
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CSV/Reader.pm view on Meta::CPAN
- escape: string, default backslash
- mutators: hashref of field name => callback($value_ref, $row_ref) pairs.
Note: the option field_aliases is processed after the option field_normalizer if given.
Note: the callbacks given with the mutators option are called in their key order (which is an unpredictable order unless they're tied with Tie::IxHash).
=cut
sub new {
my $proto = shift;
lib/CSV/Reader.pm view on Meta::CPAN
'quote_char' => $self->{'enclosure'},
%text_csv_options, # undocumented experimental feature; consider overriding _new_text_csv_object() instead.
}) || die('Method _new_text_csv_object() did not return a Text::CSV object as expected');
# Emulate the original Text::CSV error message format but without the LF and with the caller script/module.
if (0 && $text_csv->can('callbacks')) { # exists since Text::CSV_XS version 1.06
$text_csv->callbacks(
'error' => sub {
my ($err, $msg, $pos, $recno, $fldno) = @_; # This is dumb because the object itself is not given.
if ($err eq '2012') { # EOF
return;
}
view all matches for this distribution
view release on metacpan or search on metacpan
in frame if present.
(do_stack_append): validate above new fields, then make them default
to parent's values.
(do_directory_callback): pass correct ancestry information to callbacks.
----------------------------
revision 1.12
date: 2000/08/21 22:15:58; author: sussman; state: Exp; lines: +59 -31
Property-delta stuff at least compiles correctly now. :)
----------------------------
in frame if present.
(do_stack_append): validate above new fields, then make them default
to parent's values.
(do_directory_callback): pass correct ancestry information to callbacks.
----------------------------
revision 1.53
date: 2000/08/21 22:43:13; author: sussman; state: Exp; lines: +16 -4
save state
----------------------------
date: 2000/08/14 17:58:53; author: sussman; state: Exp; lines: +145 -12
Merged jimb's walker structure into svn_delta.h, jimb's own header is
not (any longer) relevant. :)
Busy filling out parser's routines to call various svn_walker_t callbacks.
----------------------------
revision 1.36
date: 2000/08/11 20:57:03; author: sussman; state: Exp; lines: +146 -130
Entire interface rewritten, in process of flushing out specific events now.
----------------------------
New error-returning strategy:
If we encounter a validation error while inside an expat callback,
1. store the error in our digger structure
2. immediately set all of the expat callbacks to NULL
Item #2 causes XML_Parse() to finish its chunk rather quickly, whereby
our main parser loop then notices the existence of #1 and returns.
----------------------------
revision 1.30
date: 2000/08/08 19:29:29; author: kfogel; state: Exp; lines: +1 -1
Recurse, or, as Noah Friedman likes to say, "recur".
----------------------------
revision 1.24
date: 2000/08/08 18:41:21; author: kfogel; state: Exp; lines: +9 -16
Allow null callbacks.
----------------------------
revision 1.23
date: 2000/08/08 17:34:03; author: sussman; state: Exp; lines: +44 -43
Delta library compiles now.
----------------------------
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Cache/AgainstFile.pm view on Meta::CPAN
a set of modules for lazy caching
=item L<Cache>
a rewrite of Cache::Cache with extra features such as validation callbacks
=back
=back
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Cache/FastMmap.pm view on Meta::CPAN
performed to create new slots/space which is done in an efficient way
=back
The class also supports read-through, and write-back or write-through
callbacks to access the real data if it's not in the cache, meaning that
code like this:
my $Value = $Cache->get($Key);
if (!defined $Value) {
$Value = $RealDataSource->get($Key);
lib/Cache/FastMmap.pm view on Meta::CPAN
Number of pages. Should be a prime number for best hashing
=back
The cache allows the use of callbacks for reading/writing data to an
underlying data store.
=over 4
=item * B<context>
lib/Cache/FastMmap.pm view on Meta::CPAN
=item I<clear()>
Clear all items from the cache
Note: If you're using callbacks, this has no effect
on items in the underlying data store. No delete
callbacks are made
=cut
sub clear {
my $Self = shift;
$Self->_expunge_all(1, 0);
lib/Cache/FastMmap.pm view on Meta::CPAN
=item I<purge()>
Clear all expired items from the cache
Note: If you're using callbacks, this has no effect
on items in the underlying data store. No delete
callbacks are made, and no write callbacks are made
for the expired data
=cut
sub purge {
my $Self = shift;
view all matches for this distribution
view release on metacpan or search on metacpan
t/CMAETest/Commands.pm view on Meta::CPAN
use Test::More;
use Test::Fatal;
my $key = random_key();
my @keys = map { "commands-$_" } (1..10);
my @callbacks = (
sub { my ($memd, $cv) = @_; $memd->flush_all(sub { is($_[0], 1, 'Flush all records'); $cv->end }); },
sub {
my ($memd, $cv) = @_;
my $cb = AE::cv {
is($_[0]->recv, 1, 'Flush all records (via condvar)');
t/CMAETest/Commands.pm view on Meta::CPAN
} );
$cv->recv;
$cv = AE::cv;
foreach my $code (@callbacks) {
$cv->begin();
eval {
$code->($memd, $cv);
};
if ($@) {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Cache/Memcached/Sweet.pm view on Meta::CPAN
}
}
=head1 NAME
Cache::Memcached::Sweet - sugary memcached with callbacks
=head1 SYNOPSIS
# Reads MEMCACHED_HOST from env, and defaults to localhost:11211 if not set
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Cache/Memcached/libmemcached.pm view on Meta::CPAN
delete $args{no_rehash};
carp "Unrecognised options: @{[ sort keys %args ]}"
if %args;
# Set compression/serialization callbacks
$self->set_callback_coderefs(
# Closures so we have reference to $self
$self->_mk_callbacks()
);
# behavior options
foreach my $option (qw(no_block hashing_algorithm distribution_method binary_protocol)) {
my $method = "set_$option";
lib/Cache/Memcached/libmemcached.pm view on Meta::CPAN
# for compatibility with Cache::Memcached
# push @{$self->{servers}}, $server;
}
sub _mk_callbacks
{
my $self = shift;
weaken($self);
my $inflate = sub {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Cache/RedisDB.pm view on Meta::CPAN
sub set {
my ($self, $namespace, $key, $value, $exptime, $callback) = @_;
if (not defined $value or ref $value or Encode::is_utf8($value)) {
state $encoder = Sereal::Encoder->new({
freeze_callbacks => 1,
});
$value = $encoder->encode($value);
}
my $cache_key = _cache_key($namespace, $key);
if (defined $exptime) {
view all matches for this distribution
view release on metacpan or search on metacpan
ChangeLog.pre-git view on Meta::CPAN
cair_perl_set_isa to cairo_perl_set_isa. Doh!
* t/CairoSurface.t: Explicitly clear the image surface on cairo
1.0.x before writing it out since 1.0.x doesn't do it for us. Use
lexical surface variables to make sure they get destroyed before
execution ends which in turn makes sure all tests inside callbacks
are run before Test::More checks if reality matches the test plan.
2006-07-15 tsch
* Cairo.pm, NEWS, README: Beta release 0.90.
view all matches for this distribution
view release on metacpan or search on metacpan
print ($@) if ($@);
# Never been able to trigger a callback.
#$session->register_callback("ENTRY ADDED", sub { print "Callback: @_\n" }, "foo", 1);
#
#$session->call_callbacks("ENTRY ADDED");
@entries = $session->list_entries(
'-//XAPIA/CSA/ENTRYATTR//NONSGML Date Created//EN' => {
type => 'DATE TIME',
value => '19970612T010654Z',
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CallBackery/GuiPlugin/Abstract.pm view on Meta::CPAN
[];
};
=head2 eventActions
A map of callbacks that will be called according to events in the
system. The following events are available:
configChanged
=cut
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Callback/Cleanup.pm view on Meta::CPAN
=pod
=head1 NAME
Callback::Cleanup - Declare callbacks that clean themselves up
=head1 SYNOPSIS
use Callback::Cleanup;
lib/Callback/Cleanup.pm view on Meta::CPAN
sub { }, # cleanup
);
=head1 DESCRIPTION
This is a very simple module that provides syntactic sugar for callbacks that
need to finalize somehow.
Callbacks are very convenient APIs when they have no definite end of life. If
an end of life behavior is required this helps keep the cleanup code and
callback code together.
lib/Callback/Cleanup.pm view on Meta::CPAN
In perl code references that are not closures aren't garbage collected (they
are shared).
This module uses L<Sub::Clone/clone_if_immortal> to make sure timely
destruction of these callbacks happens.
=head1 AUTHOR
Yuval Kogman <nothingmuch@woobling.org>
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Callback/Frame.pm view on Meta::CPAN
=encoding utf-8
=head1 NAME
Callback::Frame - Preserve error handlers and "local" variables across callbacks
=head1 SYNOPSIS
use Callback::Frame;
lib/Callback/Frame.pm view on Meta::CPAN
synopsis.pl:13 - ANONYMOUS FRAME
=head1 BACKGROUND
When programming with callbacks in perl, you create anonymous functions with C<sub { ... }>. These functions are especially useful because when they are called they will preserve their surrounding lexical environment.
In other words, the following bit of code
my $callback;
{
lib/Callback/Frame.pm view on Meta::CPAN
In order for the callback to have its dynamic environment maintained, you just need to change it to this:
$watcher = AE::io $sock, 0, fub { do_stuff() };
B<IMPORTANT NOTE>: All callbacks that may be invoked outside the dynamic environment of the current frame should be created with C<frame> or C<fub> so that the dynamic environment will be correctly re-applied when the callback is invoked.
The C<frame_try> and C<frame_catch> subs are equivalent to a call to C<frame> with C<code> and C<catch> parameters. However, unlike with C<frame>, the frame is executed immediately.
C<frame_void> takes a single callback argument. This can be useful if you wish to kick off an unassociated asynchronous action while handling. If the action is run in void context, there is no way for it to throw an exception that will affect your re...
Libraries that wrap callbacks in frames can use the C<Callback::Frame::is_frame()> function to determine if a given callback is already wrapped in a frame. It returns true if the callback is wrapped in a frame and is therefore suitable for use with C...
if (!Callback::Frame::is_frame($callback)) {
$callback = frame(code => $callback);
}
view all matches for this distribution
view release on metacpan or search on metacpan
specific versions no longer works.
+ 2001/03/29 vers 1.02 & 1.03
Changes from Raphael Manfredi <Raphael_Manfredi at pobox.com> to
add serialize method callbacks using Storable.
In addition Callback now dies if a method for a method callback
does not exist at the time of creation.
+ 2000/08/22 vers 1.02
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Carrot/Continuity/Coordination/Episode/Target/FD_Nonstop_IO.pm view on Meta::CPAN
# 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')
lib/Carrot/Continuity/Coordination/Episode/Target/FD_Nonstop_IO.pm view on Meta::CPAN
$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
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Cassandra/Client.pm view on Meta::CPAN
sub new {
my ($class, %args)= @_;
my $self= bless {
connected => 0,
connect_callbacks => undef,
shutdown => 0,
active_queries => 0,
}, $class;
lib/Cassandra/Client.pm view on Meta::CPAN
# This is ONLY useful if the user doesn't throw away the C::C object on connect errors.
if (!$self->{connecting} && (my $error= $self->{throttler}->should_fail())) {
return _cb($callback, $error);
}
push @{$self->{connect_callbacks}||=[]}, $callback;
if ($self->{connecting}++) {
return;
}
my @contact_points= shuffle @{$self->{options}{contact_points}};
lib/Cassandra/Client.pm view on Meta::CPAN
$next_connect= sub {
my $contact_point= shift @contact_points;
if (!$contact_point) {
delete $self->{connecting};
undef $next_connect;
_cb($_, "Unable to connect to any Cassandra server. Last error: $last_error") for @{delete $self->{connect_callbacks}};
return;
}
my $connection= Cassandra::Client::Connection->new(
client => $self,
lib/Cassandra/Client.pm view on Meta::CPAN
}
undef $next_connect;
$self->{connected}= 1;
delete $self->{connecting};
_cb($_) for @{delete $self->{connect_callbacks}};
});
};
$next_connect->();
return;
lib/Cassandra/Client.pm view on Meta::CPAN
[ 1, "test", 86400 ],
{ consistency => "quorum" });
=head2 Promises
C<Cassandra::Client> methods are also available as promises (see perldoc L<AnyEvent::XSPromises>). This integrates well with other libraries that deal with promises or asynchronous callbacks. Note that for promises to work, C<AnyEvent> is required, a...
Promise variants are available by prefixing method names with C<async_>, eg. C<async_connect>, C<async_execute>, etc. The usual result of the method is passed to the promise's success handler, or to the failure handler if there was an error.
# Asynchronously pages through the result set, processing data as it comes in.
my $promise= $client->async_each_page("SELECT id, column FROM my_table WHERE id=?", [ 5 ], undef, sub {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Catalyst/Action/Deserialize/Callback.pm view on Meta::CPAN
extends 'Catalyst::Action';
sub execute {
my $self = shift;
my ( $controller, $c, $callbacks ) = @_;
my $rbody;
# could be a string or a FH
if ( my $body = $c->request->body ) {
lib/Catalyst/Action/Deserialize/Callback.pm view on Meta::CPAN
$rbody = $body;
}
}
if ( $rbody ) {
my $rdata = eval { $callbacks->{deserialize}->( $rbody, $controller, $c ) };
if ($@) {
return $@;
}
$c->request->data($rdata);
} else {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Catalyst/Engine/XMPP2.pm view on Meta::CPAN
=over
=item $engine->handle_xmpp_node($app, $resource, $node)
This method is called by the stanza callbacks in the connections.
=back
=head1 SEE ALSO
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Catalyst/Manual/Components.pod view on Meta::CPAN
=head2 L<Catalyst::Plugin::MobileAgent>
=head2 L<Catalyst::Plugin::Observe>
Provides the ability to register AOP-like callbacks to specific Engine
events. Subclasses L<Class::Publisher>.
=head2 L<Catalyst::Plugin::OrderedParams>
Adjusts the way that parameters operate, causing them to appear in the same
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Catalyst/Plugin/InjectionHelpers.pm view on Meta::CPAN
based on configuration that is controlled per environment.
=head1 DESCRIPTION
B<NOTE> Starting with C<VERSION> 0.012 there is a breaking change in the number
of arguments that the C<method> and C<from_code> callbacks get. If you need to
keep backwards compatibility you should set the version flag to 1:
MyApp->config(
'Plugin::InjectionHelpers' => { version => 1 },
## Additional configuration as needed
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Catalyst/Plugin/Log/Dispatch.pm view on Meta::CPAN
$logc{'class'} = 'Handle';
$logc{'handle'} = $io;
}
my $class = sprintf( "Log::Dispatch::%s", $logc{'class'} );
delete $logc{'class'};
$logc{'callbacks'} = [$logc{'callbacks'}] if(ref($logc{'callbacks'}) eq 'CODE');
if(exists $logc{'format'} and defined $Log::Dispatch::Config::CallerDepth ) {
my $callbacks = Log::Dispatch::Config->format_to_cb($logc{'format'},0);
if(defined $callbacks) {
$logc{'callbacks'} = [] unless($logc{'callbacks'});
push(@{$logc{'callbacks'}}, $callbacks);
}
}
if( exists $logc{'format_o'} and length( $logc{'format_o'} ) ) {
my $callbacks = Catalyst::Plugin::Log::Dispatch->_format_to_cb_o($logc{'format_o'},0);
if(defined $callbacks) {
$logc{'callbacks'} = [] unless($logc{'callbacks'});
push(@{$logc{'callbacks'}}, $callbacks);
}
}
elsif(!$logc{'callbacks'}) {
$logc{'callbacks'} = sub { my %p = @_; return "$p{message}\n"; };
}
$class->use or die "$@";
my $logb = $class->new(%logc);
$logb->{rtf} = $logc{real_time_flush} || 0;
$c->log->add( $logb );
lib/Catalyst/Plugin/Log/Dispatch.pm view on Meta::CPAN
$h{name} = $_;
if( $self->{outputs}->{$_}->{rtf} ) {
$self->{outputs}->{$_}->log(%h);
}
else {
$h{message} = $self->{outputs}->{$_}->_apply_callbacks(%h)
if($self->{outputs}->{$_}->{callbacks});
push(@{$self->_body}, \%h);
}
}
}
else {
lib/Catalyst/Plugin/Log/Dispatch.pm view on Meta::CPAN
if ( $self->abort || !(scalar @{$self->_body})) {
$self->abort(undef);
}
else {
foreach my $p (@{$self->_body}) {
local $self->{outputs}->{$p->{name}}->{callbacks} = undef;
$self->{outputs}->{$p->{name}}->log(%{$p});
}
}
$self->_body([]);
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Catalyst/Plugin/Observe.pm view on Meta::CPAN
=head1 DESCRIPTION
Observe Engine events, for debugging purposes. Subclasses
L<Class::Publisher>.
C<Catalyst::Plugin::Observe> allows you to register your own callbacks
to specific Engine events (method calls), and to be notified through the
callback when they occur. When the Engine calls the event, your callback
will be called with the same arguments, which you can then display (etc.)
as necessary.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Catalyst/Plugin/RunAfterRequest.pm view on Meta::CPAN
use Moose::Role;
use MooseX::Types::Moose qw/ArrayRef CodeRef/;
use namespace::autoclean;
has callbacks => (
traits => ['Array'],
isa => ArrayRef[CodeRef],
default => sub { [] },
handles => {
run_after_request => 'push',
_callbacks => 'elements',
},
);
after finalize => sub {
my $self = shift;
for my $callback ($self->_callbacks) {
$self->$callback;
}
};
view all matches for this distribution