view release on metacpan or search on metacpan
lib/Any/Renderer/Template.pm view on Meta::CPAN
Any::Renderer::Template renders any Perl data structure passed to it with
Any::Template. The Any::Template backend used depends on the 'format' parameter passed to
the object constructor.
Templates expressed as filenames are cached using a package-level in-memory cache with Cache::AgainstFile.
This will stat the file to validate the cache before using the cached object, so if the template is updated,
this will be immediately picked up by all processes holding a cached copy.
=head1 FORMATS
All the formats supported by Any::Template. Try this to find out what's available on your system:
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AnyData.pm view on Meta::CPAN
2. delete adTie('Pipe','games.db','u')->{"user$_"} for (0..3);
# no undef needed since no hash variable created
=head2 Deletions and Packing
In order to save time and to prevent having to do writes anywhere except at the end of the file, deletions and updates are *not* done at the time of issuing a delete command. Rather when the user does a delete, the position of the deleted record is ...
=head1 MORE HELP
See the README file and the test.pl included with the module
for further examples.
view all matches for this distribution
view release on metacpan or search on metacpan
examples/test.pl view on Meta::CPAN
# $client->put_room('535881', encode_json({ room => { name => 'Room 1', topic => 'oops' } }), sub {
# my ($body, $hdr) = @_;
# if ($hdr->{Status} !~ m/2/) {
# $client->emit('error', "$hdr->{Status}: $hdr->{Reason}");
# } else {
# print "$hdr->{Status}: updated room\n";
# }
#
# $client->exit;
# });
#
view all matches for this distribution
view release on metacpan or search on metacpan
Second version;
- add URI
0.022 Thu Okt 13 2016
- bug fix in test script
- updated pod documentation
0.03 Fri Okt 14 2016
Third version;
- bug fix
- updated pod documentation
0.031 Mon Okt 24 2016
- updated pod documentation
view all matches for this distribution
view release on metacpan or search on metacpan
0.12 - 11.01.2015 17:56
Fixed dispatcher, added pool_from_dispatcher method.
0.11 - 31.12.2014 00:41
Added dispatcher method, added test, updated pod.
0.10 - 31.12.2014 00:01
Internal release.
0.09 - 27.12.2014 17:13
view all matches for this distribution
view release on metacpan or search on metacpan
my $cv = AE::cv;
$kv->put(foo => "bar", cb => sub {
my ($r, $meta) = @_;
ok $r, "key was updated";
$kv->get("foo", cb => sub {
my ($r, $meta) = @_;
is $r->value, "bar", "returned KV has correct value";
isa_ok $meta, 'Consul::Meta', "got server meta object";
view all matches for this distribution
view release on metacpan or search on metacpan
eg/replicate.pl view on Meta::CPAN
my $change = shift;
say "document "
. $change->{id}
. " with sequence "
. $change->{seq}
. " have been updated";
$couchdb_orig->open_doc( $change->{id} )->cb(
sub {
my $data = $_[0]->recv;
$couchdb_dest->save_doc($data);
}
view all matches for this distribution
view release on metacpan or search on metacpan
eg/simple_daap_server.pl view on Meta::CPAN
};
my $track = AnyEvent::DAAP::Server::Track::File::MP3->new(file => $file);
$daap->add_track($track);
$playlist->add_track($track);
}
$daap->database_updated;
undef $w;
};
$daap->setup;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AnyEvent/Discord/Client.pm view on Meta::CPAN
print "created channel $d->{id} ($d->{name}) of guild $d->{guild_id} ($self->{guilds}{$d->{guild_id}}{name})\n";
},
CHANNEL_UPDATE => sub {
my ($self, $d) = @_;
%{$self->{channels}{$d->{id}}} = %$d;
print "updated channel $d->{id} ($d->{name}) of guild $d->{guild_id} ($self->{guilds}{$d->{guild_id}}{name})\n";
},
CHANNEL_DELETE => sub {
my ($self, $d) = @_;
@{$self->{guilds}{$d->{guild_id}}{channels}} = grep {$_->{id} != $d->{id}} @{$self->{guilds}{$d->{guild_id}}{channels}} if $d->{guild_id};
delete $self->{channels}{$d->{id}};
lib/AnyEvent/Discord/Client.pm view on Meta::CPAN
print "created role $d->{role}{id} ($d->{role}{name}) of guild $d->{guild_id} ($self->{guilds}{$d->{guild_id}}{name})\n";
},
GUILD_ROLE_UPDATE => sub {
my ($self, $d) = @_;
%{$self->{roles}{$d->{role}{id}}} = %{$d->{role}};
print "updated role $d->{role}{id} ($d->{role}{name}) of guild $d->{guild_id} ($self->{guilds}{$d->{guild_id}}{name})\n";
},
GUILD_ROLE_DELETE => sub {
my ($self, $d) = @_;
@{$self->{guilds}{$d->{guild_id}}{roles}} = grep {$_->{role}{id} != $d->{role}{id}} @{$self->{guilds}{$d->{guild_id}}{roles}} if $d->{guild_id};
delete $self->{roles}{$d->{role}{id}};
view all matches for this distribution
view release on metacpan or search on metacpan
In addition, an event (basically a fake message) of type C<request_changed> is generated
on every change, which will be called as C<< $cb->($fcp, $kv, $type) >>, where C<$type>
is the type of the original message triggering the change,
To fill this cache with the global queue and keep it updated,
call C<watch_global> to subscribe to updates, followed by
C<list_persistent_requests_sync>.
$fcp->watch_global_sync_; # do not wait
$fcp->list_persistent_requests; # wait
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AnyEvent/Feed.pm view on Meta::CPAN
=item my $entry_ages = $feed_reader->entry_ages
This will set the age hash which will keep track of already seen entries.
The keys of the hash will be the calculated hashes of the entries and the
values will be a counter of how often they have NOT been seen anymore (kind of
an age counter). After each fetch this hash is updated and seen entries get
a value of 0.
=cut
sub entry_ages {
view all matches for this distribution
view release on metacpan or search on metacpan
Passing this parameter enables (simplified) cookie-processing, loosely
based on the original netscape specification.
The C<$hash_ref> must be an (initially empty) hash reference which
will get updated automatically. It is possible to save the cookie jar
to persistent storage with something like JSON or Storable - see the
C<AnyEvent::HTTP::cookie_jar_expire> function if you wish to remove
expired or session-only cookies, and also for documentation on the format
of the cookie jar.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AnyEvent/I3X/Workspace/OnDemand.pm view on Meta::CPAN
# to undef will reinit our x11 connections.
$x11 = undef;
$xroot = undef;
# This event consists of a single serialized map reporting on options
# from the barconfig of the specified bar_id that were updated in i3.
# This event is the same as a GET_BAR_CONFIG reply for the bar with the
# given id.
warn "barconfig_update is currently not supported", $/
if %barconfig_update;
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AnyEvent/IRC/Client.pm view on Meta::CPAN
=item channel_nickmode_update => $channel, $dest
This event is emitted when the (user) mode (eg. op status) of an occupant of
a channel changes. C<$dest> is the nickname on the C<$channel> who's mode was
updated.
=item channel_topic => $channel, $topic, $who
This is emitted when the topic for a channel is discovered. C<$channel>
is the channel for which C<$topic> is the current topic now.
view all matches for this distribution
view release on metacpan or search on metacpan
t/03-tiehash.t view on Meta::CPAN
is scalar keys %cache, 2;
is_deeply [sort keys %cache], [qw(bar foo)];
ok scalar %cache;
# Overwrite bar
(tied %cache)->set(bar => "updated!", "3s");
is $cache{"bar"}, "updated!";
my $w1; $w1 = AE::timer 2, 0, sub{ # 2 seconds later
is scalar keys %cache, 1;
is_deeply [sort keys %cache], [qw(bar)];
ok scalar %cache;
ok !exists $cache{"foo"};
ok exists $cache{"bar"};
is $cache{"bar"}, "updated!";
ok !exists $cache{"baz"};
};
my $w2; $w2 = AE::timer 4, 0, sub{ # 4 seconds later
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AnyEvent/JSONRPC.pm view on Meta::CPAN
shortcut of L<AnyEvent::JSONRPC::TCP::Client> and L<AnyEvent::JSONRPC::TCP::Server>.
One is C<jsonrpc_client> for Client, another is C<jsonrpc_server> for Server.
=head2 DIFFERENCES FROM THE "Lite" MODULE
This module is a fork of Daisuke Murase's L<AnyEvent::JSONRPC::Lite> updated
to use Yuval Kogman's JSON::RPC::Common for handling the JSONRPC messages.
This enables support for handling messages complying to all versions of the
JSONRPC standard.
The System Services/Service Description parts of version 1.1-wd and 1.1-alt is
view all matches for this distribution
view release on metacpan or search on metacpan
db_mon $group, $cb->(\%ports, $add, $change, $del) # new
C<grp_reg> is a no-brainer (just replace by C<db_reg>), but C<grp_get> is
no longer instant, because the local node might not have a copy of the
group. You can either modify your code to allow for a callback, or use
C<db_mon> to keep an updated copy of the group:
my $local_group_copy;
db_mon $group => sub { $local_group_copy = $_[0] };
# now "keys %$local_group_copy" always returns the most up-to-date
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AnyEvent/Net/Curl/Queued/Multi.pm view on Meta::CPAN
## no critic (RequireArgUnpacking)
sub BUILDARGS { return $_[-1] }
# socket callback: will be called by curl any time events on some
# socket must be updated
sub _cb_socket {
my ($self, undef, $socket, $poll) = @_;
# Right now $socket belongs to that $easy, but it can be
# shared with another easy handle if server supports persistent
view all matches for this distribution
view release on metacpan or search on metacpan
example/ex.pl view on Meta::CPAN
if ( $error ) {
say "err $error->{error} with $error->{server_name} $error->{server_id}";
}
if ( $result ) {
say "server_id=$result->[ 0 ] updated=$result->[ 1 ]";
}
$cv->send;
},
);
example/ex.pl view on Meta::CPAN
if ( $error ) {
say "err $error->{error} with $error->{server_name} $error->{server_id}";
}
if ( $result ) {
say "server_id=$result->[ 0 ] updated=$result->[ 1 ]";
}
$cv->send;
},
);
view all matches for this distribution
view release on metacpan or search on metacpan
Revision history for AnyEvent::Porttracker
1.01 Thu Jun 2 03:27:29 CEST 2011
- updated names.
1.0 Sat May 21 00:55:20 CEST 2011
- add "req_sync" method, which might be easier for simple scripts.
- updated the AnyEvent::Porttracker::protocol pod for porttracker 3.x.
0.1 Tue Nov 16 18:37:15 CET 2010
- first release.
0.0 Sun Nov 14 23:31:43 CET 2010
view all matches for this distribution
view release on metacpan or search on metacpan
- Unit tests improved.
- Minor internal changes.
- Minor changes in POD.
1.346 Wed Jan 15 01:45:00 MSK 2014
- Copyright updated.
1.345 Wed Jan 15 01:25:00 MSK 2014
- Command keyword is converted to lowercase.
1.344 Wed Jan 15 00:45:00 MSK 2014
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AnyEvent/Riak.pm view on Meta::CPAN
=back
=head2 put
Put request - if options.return_body is set then the updated metadata/data for the key will be returned.
=over
=item bucket
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AnyEvent/RipeRedis/Cluster.pm view on Meta::CPAN
Not set by default.
=item refresh_interval => $fractional_seconds
Cluster state refresh interval. If set to zero, cluster state will be updated
only on MOVED redirect.
By default is 15 seconds.
=item handle_params => \%params
view all matches for this distribution
view release on metacpan or search on metacpan
t/AnyEvent-HTTP-Spark.t view on Meta::CPAN
my $result=$self->createRoom($room_args);
sleep 1;
ok($result,'Should have created the room') or die "$result";
{
my $result=$self->updateTeam($teamId,{name=>$ENV{TEST_TEAM}."Renamed"});
ok($result,"Should have updated the test team wthout an error") or diag($result);
sleep 1;
}
{
my $result=$self->deleteTeam($teamId);
ok($result,"Cleaning up team $ENV{TEST_TEAM}, ID: $teamId") or diag($result);
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AnyEvent/Superfeedr/Notification.pm view on Meta::CPAN
my $feed = <<EOX;
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<id>$id</id>
<title>$title</title>
<updated>$now</updated>
<link href="$feed_uri" rel="self" />
EOX
for my $node_entry ($notification->node_entries) {
$feed .= $node_entry->as_string;
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AnyEvent/WebService/Tracks/Context.pm view on Meta::CPAN
use warnings;
use parent 'AnyEvent::WebService::Tracks::Resource';
our $VERSION = '0.02';
__PACKAGE__->readonly(qw/created_at id updated_at/);
__PACKAGE__->accessor(qw/name position/);
sub resource_path {
return 'contexts';
}
lib/AnyEvent/WebService/Tracks/Context.pm view on Meta::CPAN
=head2 id
The ID of the context in Tracks.
=head2 updated_at
When the context was last updated.
=head1 WRITABLE ATTRIBUTES
=head2 name
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AnyEvent/XMPP/Ext/VCard.pm view on Meta::CPAN
if ($error) {
$self->event (retrieve_vcard_error => $error);
}
# the own vcard was already set by retrieve
# this will push out an updated presence
$self->_publish_avatar;
});
}
}
);
view all matches for this distribution
view release on metacpan or search on metacpan
t/publish-subscribe.t view on Meta::CPAN
$pub->publish('bar: YES');
$pub->publish('qux: yes');
$pub->publish('gorch: yes');
$cv->recv;
# subscriptions updated and push_read works?
is_deeply $results, { foobar => [ map { "$_: yes" } qw/bar qux gorch/] },
'subscriptions mirror $topics attribute';
done_testing;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AnyEvent.pm view on Meta::CPAN
This returns the "current wallclock time" as a fractional number of
seconds since the Epoch (the same thing as C<time> or C<Time::HiRes::time>
return, and the result is guaranteed to be compatible with those).
It progresses independently of any event loop processing, i.e. each call
will check the system clock, which usually gets updated frequently.
=item AnyEvent->now
This also returns the "current wallclock time", but unlike C<time>, above,
this value might change only once per event loop iteration, depending on
lib/AnyEvent.pm view on Meta::CPAN
provide suitable (hopefully) replacements.
The above example isn't fictitious, the I<rxvt-unicode> (a.k.a. urxvt)
terminal emulator uses the above line as-is. An interface isn't included
in AnyEvent because it doesn't make sense outside the embedded interpreter
inside I<rxvt-unicode>, and it is updated and maintained as part of the
I<rxvt-unicode> distribution.
I<rxvt-unicode> also cheats a bit by not providing blocking access to
condition variables: code blocking while waiting for a condition will
C<die>. This still works with most modules/usages, and blocking calls must
view all matches for this distribution
view release on metacpan or search on metacpan
Change: 6c9ffdf0364e60aa1388fd968a19038e922d98aa
Author: Naveed Massjouni <naveedm9@gmail.com>
Date : 2013-05-20 03:23:37 +0000
updated gateway interface
Change: 624a2d7503b0371478718c406821d21f8f85273f
Author: Naveed Massjouni <naveedm9@gmail.com>
Date : 2013-05-19 08:42:45 +0000
view all matches for this distribution