view release on metacpan or search on metacpan
0.06 04/13
Made timeout configurable, documentation rewrites
0.05 03/31
Added better error handling and a default timeout for smtp sessions
0.04 03/22
Fixed small typo and added more verbose debugging when a connection to graphite couldn't be made
0.03 03/22
Added Graphite::SNMPAgent module, implementing a simple bridge between SNMP/Graphite servers
0.02 03/22
Added trivial test client
0.01 03/22
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AnyEvent/Groonga.pm view on Meta::CPAN
use base qw(Class::Accessor::Fast);
our $VERSION = '0.08';
__PACKAGE__->mk_accessors($_)
for qw( protocol host port groonga_path database_path command_list debug);
sub new {
my $class = shift;
my $self = $class->SUPER::new(
{ protocol => 'gqtp',
lib/AnyEvent/Groonga.pm view on Meta::CPAN
}
$key = '--' . $key;
push @array, ( $key, $value );
}
$groonga_command .= join( " ", @array ) . '"';
warn($groonga_command) if $self->debug;
return $groonga_command;
}
sub _select_filter {
my $self = shift;
view all matches for this distribution
view release on metacpan or search on metacpan
benchmark.pl view on Meta::CPAN
#!/usr/bin/env perl
use common::sense; #new features in perl
use Getopt::Long; # to command line parsing
use AnyEvent::HTTP; # use for http requests and etc. methods
use POSIX; # POSIX related stuff
use Data::Dumper; # to debug data
use AnyEvent::CacheDNS ':register'; # dns requests caching
my $DEBUG = 0; #Debug mode. Default is false (0)
my $verbose = 0; #to view the each connection result
my $timeout = 60;
my $count = 30000; #default number of requests
benchmark.pl view on Meta::CPAN
-url url to test,
-number number of requests,
-c number of parrallel clients
-verbose verbose mode
-debug debug mode
-proxy proxy
-useragent useragent string
Example :
./benchmark.pl -url http://myfavouritesite.com -n number_of_requests -c number_of_parrallel clients
benchmark.pl view on Meta::CPAN
my $result = GetOptions(
"url=s" => \$url,
"n=i" => \$count,
"c=i" => \$concurency,
"verbose=i" => \$verbose,
"debug" => \$DEBUG,
"proxy=s" => \$proxy,
"useragent=s" => \$useragent
);
if ($concurency > $count) {
view all matches for this distribution
view release on metacpan or search on metacpan
t/lib/RPC/ExtDirect/Test/Util/AnyEvent.pm view on Meta::CPAN
$req->header('Cookie', $cookie) if $cookie;
}
my $cfg_obj = RPC::ExtDirect::Config->new(
debug_serialize => 1,
%$config,
);
my $server = AnyEvent::HTTPD::ExtDirect->new(
host => $host,
view all matches for this distribution
view release on metacpan or search on metacpan
examples/anyevent-udp-server.pl view on Meta::CPAN
use AnyEvent::Handle::UDP;
use AnyEvent::Log ();
# Default for AnyEvent is to log nothing
$AnyEvent::Log::FILTER->level('debug');
# AE::Handle::UDP does all for us:
# be sure to use the "bind" option!
my $udp_server = AnyEvent::Handle::UDP->new(
# Bind to this host and port
view all matches for this distribution
view release on metacpan or search on metacpan
t/redis.conf.base view on Meta::CPAN
# For default save/load DB in/from the working directory
# Note that you must specify a directory not a file name.
dir __DIR__
# Set server verbosity to 'debug'
# it can be one of:
# debug (a lot of information, useful for development/testing)
# notice (moderately verbose, what you want in production probably)
# warning (only very important / critical messages are logged)
loglevel debug
# Specify the log file name. Also 'stdout' can be used to force
# the demon to log on the standard output. Note that if you use standard
# output for logging but daemonize, logs will be sent to /dev/null
logfile stdout
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AnyEvent/I3X/Workspace/OnDemand.pm view on Meta::CPAN
field $layout_path : param = catfile($ENV{HOME}, qw(.config i3));
field @groups;
field $starting_group :param = undef;
field $starting_workspace :param = undef;
field $debug :param = 0;
field $log_all_events :param = undef;
field $socket :param = undef;
lib/AnyEvent/I3X/Workspace/OnDemand.pm view on Meta::CPAN
field $current_workspace;
ADJUSTPARAMS {
my $args = shift;
$debug = 1 if $log_all_events;
# i3
%workspace = %{ delete $args->{workspace} }
if ref $args->{workspace} eq 'HASH';
%barconfig_update = %{ delete $args->{barconfig_update} }
lib/AnyEvent/I3X/Workspace/OnDemand.pm view on Meta::CPAN
}
method log ($msg) {
return unless $debug;
warn $msg, $/;
return;
}
method debug ($d = undef) {
return $debug unless defined $d;
$debug = $d;
}
my @any = qw(any *);
method on_workspace ($name, $type, $sub) {
lib/AnyEvent/I3X/Workspace/OnDemand.pm view on Meta::CPAN
=head1 SYNOPSIS
use AnyEvent::I3X::Workspace::OnDemand;
my $i3 = AnyEvent::I3X::Workspace::OnDemand->new(
debug => 0,
layout_path => "$ENV{HOME}/.config/i3",
workspaces => {
foo => {
layout => 'foo.json',
},
lib/AnyEvent/I3X/Workspace/OnDemand.pm view on Meta::CPAN
Execute a command, the command can be in scalar or list context.
See also L<AnyEvent::I3/command>.
=head2 $self->debug(1)
Enable or disable debug
=head2 $self->log($msg)
Print warns when debug is enabled
=head2 $self->on_tick($payload, $sub)
Subscribe to a tick event with C<< $payload >> and perform the action. Your sub
needs to support the following prototype:
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AnyEvent/IRC/Server.pm view on Meta::CPAN
while (my ($code, $name) = each %AnyEvent::IRC::Util::RFC_NUMCODE_MAP) {
*{"${name}"} = sub () { $code };
}
};
sub debugf {
return unless $ENV{AEIS_DEBUG};
require Data::Dumper;
require Term::ANSIColor;
local $Data::Dumper::Terse=1;
local $Data::Dumper::Indent=0;
lib/AnyEvent/IRC/Server.pm view on Meta::CPAN
my $say = sub {
my ($handle, $cmd, @args) = @_;
my $msg = mk_msg_ex($self->host, $cmd, $handle->{nick}, @args);
debugf("Sending '%s'", $msg);
$msg .= $CRLF;
$handle->push_write($msg)
};
my $need_more_params = sub {
my ($handle, $cmd) = @_;
lib/AnyEvent/IRC/Server.pm view on Meta::CPAN
return $need_more_params->($handle, 'NICK');
}
if ($self->nick2handle->{$nick}) {
return $say->($handle, ERR_NICKNAMEINUSE, $nick, 'Nickname already in use');
}
debugf("Set nick: %s", $nick);
$handle->{nick} = $nick;
$self->nick2handle->{$nick} = $handle;
# TODO: broadcast to each user
},
user => sub {
lib/AnyEvent/IRC/Server.pm view on Meta::CPAN
unless ($chans) {
return $need_more_params->($handle, 'JOIN');
}
for my $chan ( split /,/, $chans ) {
my $nick = $handle->{nick};
debugf("%s joined to %s", $nick, $chans);
$self->channels->{$chan}->{handles}->{$nick} = $handle;
# server reply
$say->( $handle, RPL_TOPIC(), $chan, $self->topics->{$chan} || '' );
for my $handle (values %{$self->channels->{$chan}->{handles}}) {
lib/AnyEvent/IRC/Server.pm view on Meta::CPAN
my ($name) = @{$msg->{params}};
unless ( $self->channels->{$name} ) {
# TODO: ZNC calls '*'.
# AEIS should process it.
debugf("The channel is not listed: $name");
$say->( $handle, RPL_ENDOFWHO(), 'END of /WHO list');
return;
# return $need_more_params->($handle, 'WHO'); # TODO
}
lib/AnyEvent/IRC/Server.pm view on Meta::CPAN
my ($self, $nick, $chan, @args) = @_;
# send join message
my $handle = $self->channels->{$chan}->{handles}->{$nick};
my $comment = sprintf '%s!%s@%s', $nick, $handle->{user} || $nick, $handle->{servername} || $self->servername;
my $raw = mk_msg_ex($comment, @args);
debugf("_send_chan_msg: %s", $raw);
$raw .= $CRLF;
if ($self->is_channel_name($chan)) {
for my $handle (values %{$self->channels->{$chan}->{handles}}) {
next unless $handle->{nick};
next if $handle->{nick} eq $nick;
lib/AnyEvent/IRC/Server.pm view on Meta::CPAN
sub handle_msg {
my ($self, $msg, $handle) = @_;
my $event = lc($msg->{command});
$event =~ s/^(\d+)$/irc_$1/g;
debugf("%s %s", $event, $msg);
$self->event($event, $msg, $handle);
}
# -------------------------------------------------------------------------
lib/AnyEvent/IRC/Server.pm view on Meta::CPAN
$self->_intern_privmsg($nick, $chan, $msg);
}
sub daemon_cmd_notice {
my ($self, $nick, $chan, $msg) = @_;
debugf('%s', [$nick, $chan, $msg]);
$self->_intern_notice($nick, $chan, $msg);
}
# -------------------------------------------------------------------------
lib/AnyEvent/IRC/Server.pm view on Meta::CPAN
$self->_send_chan_msg($nick, $chan, 'PRIVMSG', $chan, $text);
}
sub _intern_notice {
my ($self, $nick, $chan, $text) = @_;
debugf('%s', [$nick, $chan, $text]);
$self->_send_chan_msg($nick, $chan, 'NOTICE', $chan, $text);
}
sub _intern_topic {
my ($self, $nick, $chan, $topic) = @_;
lib/AnyEvent/IRC/Server.pm view on Meta::CPAN
$msg .= defined $prefix ? ":$prefix " : "";
$msg .= "$command";
my $trail;
debugf("%s", \@params);
if ( @params >= 2 ) {
$trail = pop @params;
}
# FIXME: params must be counted, and if > 13 they have to be
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AnyEvent/IRC/Client.pm view on Meta::CPAN
rfc_code_to_name ('471') => 'ERR_CHANNELISFULL'
NOTE: This event is also emitted when a 'ERROR' message is received.
=item debug_send => $command, @params
Is emitted everytime some command is sent.
=item debug_recv => $ircmsg
Is emitted everytime some command was received.
=back
lib/AnyEvent/IRC/Client.pm view on Meta::CPAN
$self->reg_cb (irc_pong => \&pong_cb);
$self->reg_cb (irc_privmsg => \&privmsg_cb);
$self->reg_cb (irc_notice => \&privmsg_cb);
$self->reg_cb ('irc_*' => \&debug_cb);
$self->reg_cb ('irc_*' => \&anymsg_cb);
$self->reg_cb ('irc_*' => \&update_ident_cb);
$self->reg_cb (disconnect => \&disconnect_cb);
lib/AnyEvent/IRC/Client.pm view on Meta::CPAN
=cut
sub send_msg {
my ($self, @a) = @_;
$self->event (debug_send => @a);
$self->SUPER::send_msg (@a);
}
=item $cl->send_srv ($command, @params)
lib/AnyEvent/IRC/Client.pm view on Meta::CPAN
}
$self->event (away_status_change => $self->{away_status});
}
sub debug_cb {
my ($self, $msg) = @_;
$self->event (debug_recv => $msg);
}
sub change_nick_login_cb {
my ($self, $msg) = @_;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AnyEvent/InfluxDB.pm view on Meta::CPAN
verify_peername => 'https',
ca_file => '/path/to/cacert.pem',
}
);
As an debugging aid the C<on_request> code reference may also be provided. It will
be executed before each request with the method name, url and POST data if set.
my $db = AnyEvent::InfluxDB->new(
...
on_request => sub {
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Spiffy.pm view on Meta::CPAN
no warnings;
my $self_package = shift;
# XXX Using parse_arguments here might cause confusion, because the
# subclass's boolean_arguments and paired_arguments can conflict, causing
# difficult debugging. Consider using something truly local.
my ($args, @export_list) = do {
local *boolean_arguments = sub {
qw(
-base -Base -mixin -selfless
-XXX -dumper -yaml
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Spiffy.pm view on Meta::CPAN
no warnings;
my $self_package = shift;
# XXX Using parse_arguments here might cause confusion, because the
# subclass's boolean_arguments and paired_arguments can conflict, causing
# difficult debugging. Consider using something truly local.
my ($args, @export_list) = do {
local *boolean_arguments = sub {
qw(
-base -Base -mixin -selfless
-XXX -dumper -yaml
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AnyEvent/Lingr.pm view on Meta::CPAN
else {
$cb->($hdr->{Status} . ': ' . $hdr->{Reason});
}
}
else {
debugf 'on_error callback does not set';
critf "res:%s hdr:%s", ddf($res), ddf($hdr);
}
}
sub start_session {
my ($self) = @_;
debugf "starting session...";
if ($self->session) {
debugf "found old session:%s reusing...", $self->session;
$self->get('session/verify', { session => $self->session }, sub {
my ($res, $hdr) = @_;
return unless $self;
if ($res and $res->{status} eq 'ok') {
infof "session verified: %s", $res->{session};
$self->_get_channels;
}
else {
debugf "session verify failed: %s", ddf($res || $hdr);
$self->session(undef);
$self->_on_error($res, $hdr);
}
});
}
else {
debugf "create new session...";
$self->post('session/create', {
user => $self->user,
password => $self->password,
$self->api_key ? (api_key => $self->api_key) : (),
}, sub {
my ($res, $hdr) = @_;
return unless $self;
if ($res and $res->{status} eq 'ok') {
debugf "session created: %s", $res->{session};
$self->session( $res->{session} );
$self->_get_channels;
}
else {
debugf "session create failed: %s", ddf($res || $hdr);
$self->_on_error($res, $hdr);
}
});
}
lib/AnyEvent/Lingr.pm view on Meta::CPAN
}
sub _get_channels {
my ($self) = @_;
debugf "getting joined channels";
$self->get('user/get_rooms', { session => $self->session }, sub {
my ($res, $hdr) = @_;
return unless $self;
if ($res and $res->{status} eq 'ok') {
debugf "got rooms: %s", ddf($res->{rooms});
$self->_update_room_info( $res->{rooms} );
}
else {
$self->_on_error($res, $hdr);
}
lib/AnyEvent/Lingr.pm view on Meta::CPAN
$self->get('room/show', { session => $self->session, room => join ',', @{ $rooms } }, sub {
my ($res, $hdr) = @_;
return unless $self;
if ($res and $res->{status} eq 'ok') {
debugf "got room infos";
if ($self->on_room_info) {
$self->on_room_info->($res->{rooms});
}
else {
debugf "no room info callback";
}
$self->_start_observe($rooms);
}
else {
lib/AnyEvent/Lingr.pm view on Meta::CPAN
sub _polling {
my ($self) = @_;
if ($self->_polling_guard) {
debugf 'polling session is still active, ignoring this request';
return;
}
my $uri = URI->new( $self->endpoint . 'event/observe' );
$uri->port(8080);
lib/AnyEvent/Lingr.pm view on Meta::CPAN
if ($res->{events}) {
if (my $cb = $self->on_event) {
$cb->($_) for @{ $res->{events} };
}
else {
debugf "no on_event callback";
}
}
$self->_clear_polling_guard;
$self->_polling;
view all matches for this distribution
view release on metacpan or search on metacpan
=item * The AEMP protocol is optimised for both text-based and binary
communications.
The AEMP protocol, unlike the Erlang protocol, supports both programming
language independent text-only protocols (good for debugging), and binary,
language-specific serialisers (e.g. Storable). By default, unless TLS is
used, the protocol is actually completely text-based.
It has also been carefully designed to be implementable in other languages
with a minimum of work while gracefully degrading functionality to make the
view all matches for this distribution
view release on metacpan or search on metacpan
- New script 'anyevent-mqtt-monitor' (requires Gtk2).
- Support for simple unsubscribe.
- New callback, 'message_log_callback', to log every incoming and
outgoing message.
- Avoid some cyclic references that lead to memory leaks.
- Use Sub::Name to aid debugging of anonymous subroutines.
1.110390 2011-02-08 23:01:05 Europe/London
- Add retain flag support.
- Add missing debian libanyevent-perl dependency.
- Improve tests to make them easier to debug.
1.110240 2011-01-24 21:19:02 Europe/London
- Support subscribe method with QoS levels 1 and 2.
- Support publish method with QoS levels 1 and 2.
view all matches for this distribution
view release on metacpan or search on metacpan
Resolved Issues/Bug Fixes:
* Contact list SOAP URLs were changed in official client
Notes:
* There's a lot of incomplete stuff in this dist. If you see internal
debug/devel msgs on the console, don't worry about 'em.
Version 0.001 | 2011-06-11
API Changes/Compatibility Information:
* ...see below
view all matches for this distribution
view release on metacpan or search on metacpan
examples/test.pl view on Meta::CPAN
$cv->begin(sub { $cv->send });
my $memd = AnyEvent::Memcached->new(
servers => [ '127.0.0.1:11211' ],
cv => $cv,
# debug => 1,
namespace => "test:",
);
$memd->set("key1", "val1", cb => sub {
shift or warn "Set key1 failed: @_";
view all matches for this distribution