poe component enc flac 1.01
Sponsored Links
Sponsored Links
Secleted [ 0 ] software to compare
Results 1 - 15 of about 1328
POE::Component::Enc::Flac 1.01
POE::Component::Enc::Flac is a POE component to wrap FLAC encoder flac. more>>
POE::Component::Enc::Flac is a POE component to wrap FLAC encoder flac.
SYNOPSIS
use POE qw(Component::Enc::Flac);
$encoder1 = POE::Component::Enc::Flac->new();
$encoder1->enc(input => "/tmp/track03.wav");
$encoder2 = POE::Component::Enc::Flac->new(
parent => mainSession,
priority => 10,
compression => best,
status => flacStatus,
error => flacEerror,
warning => flacWarning,
done => flacDone,
);
$encoder2->enc(
input => "/tmp/track02.wav",
output => "/tmp/02.flac",
tracknumber => Track 2,
comment => [
title=Birdhouse in your Soul,
artist=They Might be Giants,
date=1990,
origin=CD,
]
);
POE::Kernel->run();
ABSTRACT
POE is a multitasking framework for Perl. FLAC stands for Free Lossless Audio Codec and flac is an encoder for this standard. This module wraps flac into the POE framework, simplifying its use in, for example, a CD music ripper and encoder application. It provides an object oriented interface.
<<lessSYNOPSIS
use POE qw(Component::Enc::Flac);
$encoder1 = POE::Component::Enc::Flac->new();
$encoder1->enc(input => "/tmp/track03.wav");
$encoder2 = POE::Component::Enc::Flac->new(
parent => mainSession,
priority => 10,
compression => best,
status => flacStatus,
error => flacEerror,
warning => flacWarning,
done => flacDone,
);
$encoder2->enc(
input => "/tmp/track02.wav",
output => "/tmp/02.flac",
tracknumber => Track 2,
comment => [
title=Birdhouse in your Soul,
artist=They Might be Giants,
date=1990,
origin=CD,
]
);
POE::Kernel->run();
ABSTRACT
POE is a multitasking framework for Perl. FLAC stands for Free Lossless Audio Codec and flac is an encoder for this standard. This module wraps flac into the POE framework, simplifying its use in, for example, a CD music ripper and encoder application. It provides an object oriented interface.
Download (0.72MB)
Added: 2006-06-22 License: Perl Artistic License Price:
1219 downloads
PoJoe Component Libraries 1.1
PoJoe Component Libraries project is a set of Java POJO components, originally developed for OSMQ. more>>
PoJoe Component Libraries project is a set of Java POJO components, originally developed for OSMQ. Developers have found these components useful in building robust enterprise applications.
Of note are: a FIFO queue that utilizes memory until a size threshold is reached, paging overflow elements to a disk cache; a dynamic discovery mechanism for locating remote processes by name over an IP network, eliminating the need to identify a remote service with a specific host computer; and a set of peer-to-peer async message components that support n concurrent message publishers for each named subscriber.
Enhancements:
- Minor enhancements and bugfixes, and changing the license from GNU Lesser to Apache 2.0.
<<lessOf note are: a FIFO queue that utilizes memory until a size threshold is reached, paging overflow elements to a disk cache; a dynamic discovery mechanism for locating remote processes by name over an IP network, eliminating the need to identify a remote service with a specific host computer; and a set of peer-to-peer async message components that support n concurrent message publishers for each named subscriber.
Enhancements:
- Minor enhancements and bugfixes, and changing the license from GNU Lesser to Apache 2.0.
Download (0.87MB)
Added: 2007-06-12 License: The Apache License 2.0 Price:
521 downloads
POE::Component::Enc::Mp3 1.2
POE::Component::Enc::Mp3 is a mp3 encoder wrapper. more>>
POE::Component::Enc::Mp3 is a mp3 encoder wrapper.
SYNOPSIS
use POE qw(Component::Enc::Mp3);
$mp3 = POE::Component::Enc::Mp3->new($bitrate => 160);
$mp3->enc("/tmp/tst.wav");
POE::Kernel->run();
This POE component encodes raw audio files into mp3 format. It is merely a wrapper for the notlame program.
METHODS
The module provides an object oriented interface as follows:
new
Used to initialise the system and create a module instance. The following parameters are available:
alias
Indicates the name of a session to which module callbacks are posted. Default: main.
bitrate
Should be self-evident. If left unspecified, defaults to 160.
enc < file-name > [del-orig]
Encodes the given file, naming it with a .mp3 extension. An optional true value for the second parameter indicates that the original file should be deleted.
e.g. $mp3->enc("/tmp/tst.wav");
<<lessSYNOPSIS
use POE qw(Component::Enc::Mp3);
$mp3 = POE::Component::Enc::Mp3->new($bitrate => 160);
$mp3->enc("/tmp/tst.wav");
POE::Kernel->run();
This POE component encodes raw audio files into mp3 format. It is merely a wrapper for the notlame program.
METHODS
The module provides an object oriented interface as follows:
new
Used to initialise the system and create a module instance. The following parameters are available:
alias
Indicates the name of a session to which module callbacks are posted. Default: main.
bitrate
Should be self-evident. If left unspecified, defaults to 160.
enc < file-name > [del-orig]
Encodes the given file, naming it with a .mp3 extension. An optional true value for the second parameter indicates that the original file should be deleted.
e.g. $mp3->enc("/tmp/tst.wav");
Download (0.003MB)
Added: 2006-11-07 License: Perl Artistic License Price:
1081 downloads
POE::Component::OSCAR 0.05
POE::Component::OSCAR is a POE component for the Net::OSCAR module. more>>
POE::Component::OSCAR is a POE component for the Net::OSCAR module.
SYNOPSIS
use POE qw(Component::OSCAR);
[ ... POE set up ... ]
sub _start { # start an OSCAR session $oscar = POE::Component::OSCAR->new();
# start an OSCAR session with automatic throttling of new connections
# to prevent being banned by the server
$oscar = POE::Component::OSCAR->new( throttle => 4 );
# set up the "im_in" callback to call your state, "im_in_state"
$oscar->set_callback( im_in => im_in_state);
# its good to detect errors if you dont want to get banned
$oscar->set_callback( error => error_state );
$oscar->set_callback( admin_error => admin_erro_stater );
$oscar->set_callback( rate_alert => rate_alert_state );
# sign on
$oscar->signon( screenname => $MY_SCREENNAME, password => $MY_PASSWORD );
}
sub im_in_state { my ($nothing, $args) = @_[ARG0..$#_]; my ($object, $who, $what, $away) = @$args;
print "Got $what from $whon";
}
<<lessSYNOPSIS
use POE qw(Component::OSCAR);
[ ... POE set up ... ]
sub _start { # start an OSCAR session $oscar = POE::Component::OSCAR->new();
# start an OSCAR session with automatic throttling of new connections
# to prevent being banned by the server
$oscar = POE::Component::OSCAR->new( throttle => 4 );
# set up the "im_in" callback to call your state, "im_in_state"
$oscar->set_callback( im_in => im_in_state);
# its good to detect errors if you dont want to get banned
$oscar->set_callback( error => error_state );
$oscar->set_callback( admin_error => admin_erro_stater );
$oscar->set_callback( rate_alert => rate_alert_state );
# sign on
$oscar->signon( screenname => $MY_SCREENNAME, password => $MY_PASSWORD );
}
sub im_in_state { my ($nothing, $args) = @_[ARG0..$#_]; my ($object, $who, $what, $away) = @$args;
print "Got $what from $whon";
}
Download (0.006MB)
Added: 2007-04-18 License: Perl Artistic License Price:
919 downloads
POE::Component::Basement 0.01
POE::Component::Basement provides Class::Std and base POE component functionality. more>>
POE::Component::Basement provides Class::Std and base POE component functionality.
SYNOPSIS
package POE::MyComponent;
# use as base
use base qw/ POE::Component::Basement /;
# where the initializations happen (see Class::Std)
sub BUILD { ... }
# see also Class::Std and Class::Data::Inheritable also
# for accessor creation etc.
# define states
sub state_one : State( :inline< _start > ) { ... }
sub state_two : State( :object< foo > ) { ... }
sub state_three : State( :package< bar > ) { ... }
# combined
sub state_multi : State( :inline< foobar > :package< snafoo > ) { ... }
...
# chained events
sub first : State( :object< foo > :chained< bar > ) { ... }
sub second : State( :object< bar > ) { ... }
...
# calling in a row
sub first : State( :object< foo > :next< bar > ) { ... }
sub second : State( :object< bar > ) { ... }
...
# usage
my $comp = POE::MyComponent->new ({
# single alias or array reference for multiple
aliases => [qw/ mycomp shub_niggurath /],
... # your specific init_args.
});
Provides Class::Std and base POE component functionality. This module is still kinda experimental.
<<lessSYNOPSIS
package POE::MyComponent;
# use as base
use base qw/ POE::Component::Basement /;
# where the initializations happen (see Class::Std)
sub BUILD { ... }
# see also Class::Std and Class::Data::Inheritable also
# for accessor creation etc.
# define states
sub state_one : State( :inline< _start > ) { ... }
sub state_two : State( :object< foo > ) { ... }
sub state_three : State( :package< bar > ) { ... }
# combined
sub state_multi : State( :inline< foobar > :package< snafoo > ) { ... }
...
# chained events
sub first : State( :object< foo > :chained< bar > ) { ... }
sub second : State( :object< bar > ) { ... }
...
# calling in a row
sub first : State( :object< foo > :next< bar > ) { ... }
sub second : State( :object< bar > ) { ... }
...
# usage
my $comp = POE::MyComponent->new ({
# single alias or array reference for multiple
aliases => [qw/ mycomp shub_niggurath /],
... # your specific init_args.
});
Provides Class::Std and base POE component functionality. This module is still kinda experimental.
Download (0.017MB)
Added: 2006-10-23 License: Perl Artistic License Price:
1096 downloads
POE::Component::Growl 1.00
POE::Component::Growl provides a Growl notification dispatcher for POE. more>>
POE::Component::Growl provides a Growl notification dispatcher for POE.
POE::Component::Growl provides a facility for notifying events through Growl using the Mac::Growl module as back-end. Integration with POEs architecture allows easy, non-blocking notifications.
Multiple notifiers can be spawned within the same POE application with multiple default options..
A program must spawn at least one POE::Component::Growl instance before it can perform Growl notifications. Each instance registers itself with Growl itself by passing a few parameters to it, and a reference to the object is returned for optional manual handling (see notify method below).
The following parameters can be passed to the spawn constructor (AppName and Notifications are required).
AppName
This must contain the name of the application. It may be a free string as it isnt required to match any existing file name; its purpose is only to let Growl define user preferences for each application.
Notifications
This must be an arrayref containing the list of possible notifications from our application. These names will be displayed in Growl preference pane to let users customize options for each notification.
DefaultNotificatons
(Optional) This parameter can contain an arrayref with the list of notifications to enable by default. If DefaultNotifications isnt provided, POE::Component::Growl will enable all available notifications, otherwise the user will have to manually enable those which arent included here.
Alias
(Optional) This parameter will be used to set POEs internal session alias. This is useful to post events and is also very important if you instantiate multiple notifiers. If left empty, the alias will be set to "Growl".
IconOfApp
(Optional) This parameter can contain the name of an application whose icon is to use by default.
<<lessPOE::Component::Growl provides a facility for notifying events through Growl using the Mac::Growl module as back-end. Integration with POEs architecture allows easy, non-blocking notifications.
Multiple notifiers can be spawned within the same POE application with multiple default options..
A program must spawn at least one POE::Component::Growl instance before it can perform Growl notifications. Each instance registers itself with Growl itself by passing a few parameters to it, and a reference to the object is returned for optional manual handling (see notify method below).
The following parameters can be passed to the spawn constructor (AppName and Notifications are required).
AppName
This must contain the name of the application. It may be a free string as it isnt required to match any existing file name; its purpose is only to let Growl define user preferences for each application.
Notifications
This must be an arrayref containing the list of possible notifications from our application. These names will be displayed in Growl preference pane to let users customize options for each notification.
DefaultNotificatons
(Optional) This parameter can contain an arrayref with the list of notifications to enable by default. If DefaultNotifications isnt provided, POE::Component::Growl will enable all available notifications, otherwise the user will have to manually enable those which arent included here.
Alias
(Optional) This parameter will be used to set POEs internal session alias. This is useful to post events and is also very important if you instantiate multiple notifiers. If left empty, the alias will be set to "Growl".
IconOfApp
(Optional) This parameter can contain the name of an application whose icon is to use by default.
Download (0.004MB)
Added: 2007-03-29 License: Perl Artistic License Price:
939 downloads
POE::Component::DebugShell 1.0411
POE::Component::DebugShell is a component to allow interactive peeking into a running POE application. more>>
POE::Component::DebugShell is a component to allow interactive peeking into a running POE application.
SYNOPSIS
use POE::Component::DebugShell;
POE::Component::DebugShell->spawn();
This component allows for interactive peeking into a running POE application.
spawn() creates a ReadLine enabled shell equipped with various debug commands. The following commands are available.
COMMANDS
show_sessions
debug> show_sessions
* 3 [ session 3 (POE::Component::DebugShell controller) ]
* 2 [ session 2 (PIE, PIE2) ]
Show a list of all sessions in the system. The output format is in the form of loggable session ids.
session_stats
debug> session_stats 2
Statistics for Session 2
Events coming from: 1
Events going to: 1
Display various statistics for a given session. Provide one session id as a parameter.
list_aliases
debug> list_aliases 2
Alias list for session 2
* PIE
* PIE2
List aliases for a given session id. Provide one session id as a parameter.
queue_dump
debug> queue_dump
Event Queue:
* ID: 738 - Index: 0
Priority: 1078459009.06715
Event: _sigchld_poll
* ID: 704 - Index: 1
Priority: 1078459012.42691
Event: ping
Dump the contents of the event queue. Add a -v parameter to get verbose output.
help
debug> help
The following commands are available:
...
Display help about available commands.
status
debug> status
This is POE::Component::DebugShell v1.14
running inside examples/foo.perl.
This console spawned at Thu Mar 4 22:51:51 2004.
There are 3 known sessions (including the kernel).
General shell status.
reload
debug> reload
Reloading...
Reload the shell
exit
debug> exit
Exiting...
Exit the shell
<<lessSYNOPSIS
use POE::Component::DebugShell;
POE::Component::DebugShell->spawn();
This component allows for interactive peeking into a running POE application.
spawn() creates a ReadLine enabled shell equipped with various debug commands. The following commands are available.
COMMANDS
show_sessions
debug> show_sessions
* 3 [ session 3 (POE::Component::DebugShell controller) ]
* 2 [ session 2 (PIE, PIE2) ]
Show a list of all sessions in the system. The output format is in the form of loggable session ids.
session_stats
debug> session_stats 2
Statistics for Session 2
Events coming from: 1
Events going to: 1
Display various statistics for a given session. Provide one session id as a parameter.
list_aliases
debug> list_aliases 2
Alias list for session 2
* PIE
* PIE2
List aliases for a given session id. Provide one session id as a parameter.
queue_dump
debug> queue_dump
Event Queue:
* ID: 738 - Index: 0
Priority: 1078459009.06715
Event: _sigchld_poll
* ID: 704 - Index: 1
Priority: 1078459012.42691
Event: ping
Dump the contents of the event queue. Add a -v parameter to get verbose output.
help
debug> help
The following commands are available:
...
Display help about available commands.
status
debug> status
This is POE::Component::DebugShell v1.14
running inside examples/foo.perl.
This console spawned at Thu Mar 4 22:51:51 2004.
There are 3 known sessions (including the kernel).
General shell status.
reload
debug> reload
Reloading...
Reload the shell
exit
debug> exit
Exiting...
Exit the shell
Download (0.007MB)
Added: 2007-02-13 License: Perl Artistic License Price:
983 downloads
POE::Component::Generic 0.0904
POE::Component::Generic is a POE component that provides non-blocking access to a blocking object. more>>
POE::Component::Generic is a POE component that provides non-blocking access to a blocking object.
SYNOPSIS
use POE::Component::Generic;
my $telnet = POE::Component::Generic->spawn(
# required; main object is of this class
package => Net::Telnet,
# optional; Options passed to Net::Telnet->new()
object_options => [ ],
# optional; You can use $poco->session_id() instead
alias => telnet,
# optional; 1 to turn on debugging
debug => 1,
# optional; 1 to see the childs STDERR
verbose => 1,
# optional; Options passed to the internal session
options => { trace => 1 },
# optional; describe package signatures
packages => {
Net::Telnet => {
# Methods that require coderefs, and keep them after they
# return.
# The first arg is converted to a coderef
postbacks => { option_callback=>0 }
},
Other::Package => {
# only these methods are exposed
methods => [ qw( one two ) ],
# Methods that require coderefs, but dont keep them
# after they return
callbacks => [ qw( two ) ]
}
}
);
# Start your POE session, then...
$telnet->open( { event => result }, "rainmaker.wunderground.com");
# result state
sub result {
my ($kernel, $ref, $result) = @_[KERNEL, ARG0, ARG1];
if( $ref->{error} ) {
die join( , @{ $ref->{error} ) . "n";
}
print "connected: $resultn";
}
# Setup a postback
$telnet->option_callback( {}, "option_back" );
# option_back state
sub option_back {
my( $obj, $option, $is_remote,
$is_enabled, $was_enabled, $buf_position) = @_[ARG0..$#_];
# See L for a discussion of the above.
# NOTE: Callbacks and postbacks cant currently receive objects.
}
# Use a callback
# Pretend that $other was created as a proxy to an Other::Package object
$other->two( {}, sub { warn "I was called..." } );
my $code = $session->postback( "my_state" );
$other->two( {}, $code );
POE::Component::Generic is a POE component that provides a non-blocking wrapper around any object. It works by forking a child process with POE::Wheel::Run and creating the object in the child process. Method calls are then serialised and sent via STDIN to the child to be handled. Return values are posted back to your session via STDOUT. This means that all method arguments and return values must survive serialisation. If you need to pass coderefs, use "callbacks", "postbacks" or "factories".
Method calls are wrapped in eval in the child process so that errors may be propagated back to your session. See "OUTPUT".
Output to STDERR in the child, that is from your object, is shown only if debug or verbose is set.
STDOUT in the child, that is from your object, is redirected to STDERR and will be shown in the same circomstances.
<<lessSYNOPSIS
use POE::Component::Generic;
my $telnet = POE::Component::Generic->spawn(
# required; main object is of this class
package => Net::Telnet,
# optional; Options passed to Net::Telnet->new()
object_options => [ ],
# optional; You can use $poco->session_id() instead
alias => telnet,
# optional; 1 to turn on debugging
debug => 1,
# optional; 1 to see the childs STDERR
verbose => 1,
# optional; Options passed to the internal session
options => { trace => 1 },
# optional; describe package signatures
packages => {
Net::Telnet => {
# Methods that require coderefs, and keep them after they
# return.
# The first arg is converted to a coderef
postbacks => { option_callback=>0 }
},
Other::Package => {
# only these methods are exposed
methods => [ qw( one two ) ],
# Methods that require coderefs, but dont keep them
# after they return
callbacks => [ qw( two ) ]
}
}
);
# Start your POE session, then...
$telnet->open( { event => result }, "rainmaker.wunderground.com");
# result state
sub result {
my ($kernel, $ref, $result) = @_[KERNEL, ARG0, ARG1];
if( $ref->{error} ) {
die join( , @{ $ref->{error} ) . "n";
}
print "connected: $resultn";
}
# Setup a postback
$telnet->option_callback( {}, "option_back" );
# option_back state
sub option_back {
my( $obj, $option, $is_remote,
$is_enabled, $was_enabled, $buf_position) = @_[ARG0..$#_];
# See L for a discussion of the above.
# NOTE: Callbacks and postbacks cant currently receive objects.
}
# Use a callback
# Pretend that $other was created as a proxy to an Other::Package object
$other->two( {}, sub { warn "I was called..." } );
my $code = $session->postback( "my_state" );
$other->two( {}, $code );
POE::Component::Generic is a POE component that provides a non-blocking wrapper around any object. It works by forking a child process with POE::Wheel::Run and creating the object in the child process. Method calls are then serialised and sent via STDIN to the child to be handled. Return values are posted back to your session via STDOUT. This means that all method arguments and return values must survive serialisation. If you need to pass coderefs, use "callbacks", "postbacks" or "factories".
Method calls are wrapped in eval in the child process so that errors may be propagated back to your session. See "OUTPUT".
Output to STDERR in the child, that is from your object, is shown only if debug or verbose is set.
STDOUT in the child, that is from your object, is redirected to STDERR and will be shown in the same circomstances.
Download (0.030MB)
Added: 2006-06-12 License: Perl Artistic License Price:
1229 downloads
POE::Component::ControlPort 0.01
POE::Component::ControlPort is a Perl module with network control port for POE applications. more>>
POE::Component::ControlPort is a Perl module with network control port for POE applications.
SYNOPSIS
use POE;
use Getopt::Long;
use POE::Component::ControlPort;
use POE::Component::ControlPort::Command;
my @commands = (
{
help_text => My command,
usage => my_command [ arg1, arg2 ],
topic => custom,
name => my_command,
command => sub {
my %input = @_;
local @ARGV = @{ $input{args} };
GetOptions( ... );
},
}
);
POE::Component::ControlPort->create(
local_address => 127.0.0.1,
local_port => 31337,
# optional...
hostname => pie.pants.org,
appname => my perl app,
commands => @commands,
poe_debug => 1,
);
# other poe sessions or whatever ...
POE::Kernel->run();
When building network applications, it is often helpful to have a network accessible control and diagnostic interface. This module provides such an interface for POE applications. By default, it provides a fairly limited set of commands but is easily extended to provide whatever command set you require. In addition, if POE::Component::DebugShell version 1.018 or above is installed, a set of POE debug commands will be loaded.
<<lessSYNOPSIS
use POE;
use Getopt::Long;
use POE::Component::ControlPort;
use POE::Component::ControlPort::Command;
my @commands = (
{
help_text => My command,
usage => my_command [ arg1, arg2 ],
topic => custom,
name => my_command,
command => sub {
my %input = @_;
local @ARGV = @{ $input{args} };
GetOptions( ... );
},
}
);
POE::Component::ControlPort->create(
local_address => 127.0.0.1,
local_port => 31337,
# optional...
hostname => pie.pants.org,
appname => my perl app,
commands => @commands,
poe_debug => 1,
);
# other poe sessions or whatever ...
POE::Kernel->run();
When building network applications, it is often helpful to have a network accessible control and diagnostic interface. This module provides such an interface for POE applications. By default, it provides a fairly limited set of commands but is easily extended to provide whatever command set you require. In addition, if POE::Component::DebugShell version 1.018 or above is installed, a set of POE debug commands will be loaded.
Download (0.012MB)
Added: 2007-02-13 License: Perl Artistic License Price:
983 downloads
POE::Component::Client::FTP 0.07
POE::Component::Client::FTP is a Perl module that implements an FTP client POE Component. more>>
POE::Component::Client::FTP is a Perl module that implements an FTP client POE Component.
SYNOPSIS
use POE::Component::Client::FTP;
POE::Component::Client::FTP->spawn ( Alias => ftp, Username => test, Password => test, RemoteAddr => localhost, Events => [ qw( authenticated put_connected put_error put_closed get_connected get_data get_done size ) ] );
# we are authenticated sub authenticated { $poe_kernel->post(ftp, command, args); }
# data connection is ready for data sub put_connected { my ($status, $line, $param) = @_[ARG0..ARG3];
open FILE, "/etc/passwd" or die $!;
$poe_kernel->post(ftp, put_data, $_) while ( );
close FILE;
$poe_kernel->post(ftp, put_close);
}
# something bad happened sub put_error { my ($error, $param) = @_[ARG0,ARG1];
warn "ERROR: $error occured while trying to STOR $param";
}
# data connection closed sub put_closed { my ($param) = @_[ARG0]; }
# file on the way... sub get_connected { my ($filename) = @_[ARG0]; }
# getting data from the file... sub get_data { my ($data, $filename) = @_[ARG0,ARG1];
}
# and its done sub get_done { my ($filename) = @_[ARG0]; }
# response to a size command sub size { my ($code, $size, $filename) = @_[ARG0,ARG1,ARG2];
print "$filename was $size";
}
$poe_kernel->run();
<<lessSYNOPSIS
use POE::Component::Client::FTP;
POE::Component::Client::FTP->spawn ( Alias => ftp, Username => test, Password => test, RemoteAddr => localhost, Events => [ qw( authenticated put_connected put_error put_closed get_connected get_data get_done size ) ] );
# we are authenticated sub authenticated { $poe_kernel->post(ftp, command, args); }
# data connection is ready for data sub put_connected { my ($status, $line, $param) = @_[ARG0..ARG3];
open FILE, "/etc/passwd" or die $!;
$poe_kernel->post(ftp, put_data, $_) while ( );
close FILE;
$poe_kernel->post(ftp, put_close);
}
# something bad happened sub put_error { my ($error, $param) = @_[ARG0,ARG1];
warn "ERROR: $error occured while trying to STOR $param";
}
# data connection closed sub put_closed { my ($param) = @_[ARG0]; }
# file on the way... sub get_connected { my ($filename) = @_[ARG0]; }
# getting data from the file... sub get_data { my ($data, $filename) = @_[ARG0,ARG1];
}
# and its done sub get_done { my ($filename) = @_[ARG0]; }
# response to a size command sub size { my ($code, $size, $filename) = @_[ARG0,ARG1,ARG2];
print "$filename was $size";
}
$poe_kernel->run();
Download (0.013MB)
Added: 2007-04-17 License: Perl Artistic License Price:
920 downloads
POE::Component::Server::IRC 1.05
POE::Component::Server::IRC is a fully event-driven networkable IRC server daemon module. more>>
POE::Component::Server::IRC is a fully event-driven networkable IRC server daemon module.
SYNOPSIS
# A fairly simple example:
use strict;
use warnings;
use POE qw(Component::Server::IRC);
my %config = (
servername => simple.poco.server.irc,
nicklen => 15,
network => SimpleNET
);
my $pocosi = POE::Component::Server::IRC->spawn( config => %config );
POE::Session->create(
package_states => [
main => [qw(_start _default)],
],
heap => { ircd => $pocosi },
);
$poe_kernel->run();
exit 0;
sub _start {
my ($kernel,$heap) = @_[KERNEL,HEAP];
$heap->{ircd}->yield( register );
# Anyone connecting from the loopback gets spoofed hostname
$heap->{ircd}->add_auth( mask => *@localhost, spoof => m33p.com, no_tilde => 1 );
# We have to add an auth as we have specified one above.
$heap->{ircd}->add_auth( mask => *@* );
# Start a listener on the standard IRC port.
$heap->{ircd}->add_listener( port => 6667 );
# Add an operator who can connect from localhost
$heap->{ircd}->add_operator( { username => moo, password => fishdont } );
undef;
}
sub _default {
my ( $event, $args ) = @_[ ARG0 .. $#_ ];
print STDOUT "$event: ";
foreach (@$args) {
SWITCH: {
if ( ref($_) eq ARRAY ) {
print STDOUT "[", join ( ", ", @$_ ), "] ";
last SWITCH;
}
if ( ref($_) eq HASH ) {
print STDOUT "{", join ( ", ", %$_ ), "} ";
last SWITCH;
}
print STDOUT "$_ ";
}
}
print STDOUT "n";
return 0; # Dont handle signals.
}
POE::Component::Server::IRC is a POE component which implements an IRC server ( also referred to as an IRC daemon or IRCd ). It should be compliant with the pertient IRC RFCs and is based on reverse engineering Hybrid IRCd behaviour with regards to interactions with IRC clients and other IRC servers.
Yes, thats right. POE::Component::Server::IRC is capable of linking to form IRC networks. It supports the TS5 server to server protocol and has been tested with linking to Hybrid-7 based networks. It should in theory work with any TS5-based IRC network.
POE::Component::Server::IRC also has a services API, which enables one to extend the IRCd to create IRC Services. This is fully event-driven ( of course =] ). There is also a Plugin system, similar to that sported by POE::Component::IRC.
<<lessSYNOPSIS
# A fairly simple example:
use strict;
use warnings;
use POE qw(Component::Server::IRC);
my %config = (
servername => simple.poco.server.irc,
nicklen => 15,
network => SimpleNET
);
my $pocosi = POE::Component::Server::IRC->spawn( config => %config );
POE::Session->create(
package_states => [
main => [qw(_start _default)],
],
heap => { ircd => $pocosi },
);
$poe_kernel->run();
exit 0;
sub _start {
my ($kernel,$heap) = @_[KERNEL,HEAP];
$heap->{ircd}->yield( register );
# Anyone connecting from the loopback gets spoofed hostname
$heap->{ircd}->add_auth( mask => *@localhost, spoof => m33p.com, no_tilde => 1 );
# We have to add an auth as we have specified one above.
$heap->{ircd}->add_auth( mask => *@* );
# Start a listener on the standard IRC port.
$heap->{ircd}->add_listener( port => 6667 );
# Add an operator who can connect from localhost
$heap->{ircd}->add_operator( { username => moo, password => fishdont } );
undef;
}
sub _default {
my ( $event, $args ) = @_[ ARG0 .. $#_ ];
print STDOUT "$event: ";
foreach (@$args) {
SWITCH: {
if ( ref($_) eq ARRAY ) {
print STDOUT "[", join ( ", ", @$_ ), "] ";
last SWITCH;
}
if ( ref($_) eq HASH ) {
print STDOUT "{", join ( ", ", %$_ ), "} ";
last SWITCH;
}
print STDOUT "$_ ";
}
}
print STDOUT "n";
return 0; # Dont handle signals.
}
POE::Component::Server::IRC is a POE component which implements an IRC server ( also referred to as an IRC daemon or IRCd ). It should be compliant with the pertient IRC RFCs and is based on reverse engineering Hybrid IRCd behaviour with regards to interactions with IRC clients and other IRC servers.
Yes, thats right. POE::Component::Server::IRC is capable of linking to form IRC networks. It supports the TS5 server to server protocol and has been tested with linking to Hybrid-7 based networks. It should in theory work with any TS5-based IRC network.
POE::Component::Server::IRC also has a services API, which enables one to extend the IRCd to create IRC Services. This is fully event-driven ( of course =] ). There is also a Plugin system, similar to that sported by POE::Component::IRC.
Download (0.084MB)
Added: 2006-11-28 License: Perl Artistic License Price:
1062 downloads
POE::Component::Client::TCPMulti 0.0521
POE::Component::Client::TCPMulti is a high performance client TCP library. more>>
POE::Component::Client::TCPMulti is a high performance client TCP library.
SYNOPSIS
# Short Usage
POE::Component::Client::TCPMulti->create
( InputEvent => sub {
printf "%s:%d: %s",
$_[CHEAP]->ADDR, $_[CHEAP]->PORT, $_[ARG0];
},
SuccessEvent => sub {
printf "%s:%d: Connection Recieved",
$_[CHEAP]->ADDR, $_[CHEAP]->PORT;
$_[KERNEL]->yield( send => "" );
},
inline_states => {
_start => sub {
$_[KERNEL]->yield( connect => "127.0.0.1", $_ )
for 1..1024;
},
},
InputTimeout => 15,
);
# Longer Usage
POE::Component::Client::TCPMulti->create
( InputEvent => sub {
$_[KERNEL]->yield(send => $_[CHEAP]->ID, "Some Stuff");
},
Initialize => sub {
$_[CHEAP]->input_filter
( "POE::Filter::Block", BlockSize => 4);
},
ErrorEvent => &ErrorHandle,
Disconnected => &ErrorHandle,
TimeoutEvent => &TimeoutHandle,
FailureEvent => &FailureHandle,
SuccessEvent => sub {
$_[CHEAP]->filter("POE::Filter::Line");
# Set timeout for this connection to 350 seconds.
$_[CHEAP]->timeout(350);
# This state is part of the component interface
$_[KERNEL]->yield(send => $_[CHEAP]->ID, "Some Data");
},
Domain => AF_INET, # Optional
Alias => "MySession", # Optional
InputTimeout => 360, # Seconds, Optional
ConnectTimeout => 30, # Seconds, Optional
Timeout => 30, # Seconds, Optional
Filter => "POE::Filter::Something", # Optional
inline_states => {
_start => sub {
$_[KERNEL]->yield(connect => q(127.0.0.1), 25);
# _start isnt needed if you use an alias.
},
},
args => $Session_Args, # Optional
object_states => $Object_States, # Optional
package_states => $Package_States, # Optional
);
# This should be done from within a state in the TCPMulti
# Session. Its purpose is to allow prepropigation of the
# connection heap as well as connection specific timeout
# Settings.
POE::Component::Client::TCPMulti->connect
( RemoteAddress => "127.0.0.1",
RemotePort => 25,
BindAddress => "127.0.0.1", # Optional
BindPort => 0, # Optional
ConnectTimeout => 50, # Connect only.
InputTimeout => 300, # Input only.
Heap => %Propigation );
POE::Component::Client::TCPMulti is a very lightweight, highly optimized component designed for large numbers of simultanious outgoing connections. The major advantage to this module over POE::Component::Client::TCP is that it runs in a single session, reguardless of the number of outgoing simultanious connections. I have found this in fact to use considerable less overhead than POE::Component::Client::TCP in high traffic. The disadvantage lies mearly in the API complexity over POE::Component::Client::TCP.
It is in fact due to this added API complexity that I decided to create a seperate module, rather than altering POE::Component::Client::TCP [ or coaxing Rocco to let me ]. POE::Component::Client::TCP is a great module and this is not designed to completely replace it. It is however designed as a solution for extremely high traffic situations when the overhead of an individual session for each outgoing connection is not appropriate for the added simplicity in the API. Especially considering that this API is not really *that* much more complex.
<<lessSYNOPSIS
# Short Usage
POE::Component::Client::TCPMulti->create
( InputEvent => sub {
printf "%s:%d: %s",
$_[CHEAP]->ADDR, $_[CHEAP]->PORT, $_[ARG0];
},
SuccessEvent => sub {
printf "%s:%d: Connection Recieved",
$_[CHEAP]->ADDR, $_[CHEAP]->PORT;
$_[KERNEL]->yield( send => "" );
},
inline_states => {
_start => sub {
$_[KERNEL]->yield( connect => "127.0.0.1", $_ )
for 1..1024;
},
},
InputTimeout => 15,
);
# Longer Usage
POE::Component::Client::TCPMulti->create
( InputEvent => sub {
$_[KERNEL]->yield(send => $_[CHEAP]->ID, "Some Stuff");
},
Initialize => sub {
$_[CHEAP]->input_filter
( "POE::Filter::Block", BlockSize => 4);
},
ErrorEvent => &ErrorHandle,
Disconnected => &ErrorHandle,
TimeoutEvent => &TimeoutHandle,
FailureEvent => &FailureHandle,
SuccessEvent => sub {
$_[CHEAP]->filter("POE::Filter::Line");
# Set timeout for this connection to 350 seconds.
$_[CHEAP]->timeout(350);
# This state is part of the component interface
$_[KERNEL]->yield(send => $_[CHEAP]->ID, "Some Data");
},
Domain => AF_INET, # Optional
Alias => "MySession", # Optional
InputTimeout => 360, # Seconds, Optional
ConnectTimeout => 30, # Seconds, Optional
Timeout => 30, # Seconds, Optional
Filter => "POE::Filter::Something", # Optional
inline_states => {
_start => sub {
$_[KERNEL]->yield(connect => q(127.0.0.1), 25);
# _start isnt needed if you use an alias.
},
},
args => $Session_Args, # Optional
object_states => $Object_States, # Optional
package_states => $Package_States, # Optional
);
# This should be done from within a state in the TCPMulti
# Session. Its purpose is to allow prepropigation of the
# connection heap as well as connection specific timeout
# Settings.
POE::Component::Client::TCPMulti->connect
( RemoteAddress => "127.0.0.1",
RemotePort => 25,
BindAddress => "127.0.0.1", # Optional
BindPort => 0, # Optional
ConnectTimeout => 50, # Connect only.
InputTimeout => 300, # Input only.
Heap => %Propigation );
POE::Component::Client::TCPMulti is a very lightweight, highly optimized component designed for large numbers of simultanious outgoing connections. The major advantage to this module over POE::Component::Client::TCP is that it runs in a single session, reguardless of the number of outgoing simultanious connections. I have found this in fact to use considerable less overhead than POE::Component::Client::TCP in high traffic. The disadvantage lies mearly in the API complexity over POE::Component::Client::TCP.
It is in fact due to this added API complexity that I decided to create a seperate module, rather than altering POE::Component::Client::TCP [ or coaxing Rocco to let me ]. POE::Component::Client::TCP is a great module and this is not designed to completely replace it. It is however designed as a solution for extremely high traffic situations when the overhead of an individual session for each outgoing connection is not appropriate for the added simplicity in the API. Especially considering that this API is not really *that* much more complex.
Download (0.023MB)
Added: 2007-04-17 License: Perl Artistic License Price:
920 downloads
POE::Component::Client::Ping 1.13
POE::Component::Client::Ping is a non-blocking ICMP ping client. more>>
POE::Component::Client::Ping is a non-blocking ICMP ping client.
SYNOPSIS
use POE qw(Component::Client::Ping);
POE::Component::Client::Ping->spawn(
Alias => "pingthing", # defaults to "pinger"
Timeout => 10, # defaults to 1 second
Retry => 3, # defaults to 1 attempt
OneReply => 1, # defaults to disabled
Parallelism => 20, # defaults to undef
BufferSize => 65536, # defaults to undef
AlwaysDecodeAddress => 1, # defaults to 0
);
sub some_event_handler {
$kernel->post(
"pingthing", # Post the request to the "pingthing" component.
"ping", # Ask it to "ping" an address.
"pong", # Have it post an answer as a "pong" event.
$address, # This is the address we want to ping.
$timeout, # Optional timeout. It overrides the default.
$retry, # Optional retries. It overrides the default.
);
}
# This is the sub which is called when the session receives a "pong"
# event. It handles responses from the Ping component.
sub got_pong {
my ($request, $response) = @_[ARG0, ARG1];
my ($req_address, $req_timeout, $req_time) = @$request;
my ($resp_address, $roundtrip_time, $resp_time, $resp_ttl) = @$response;
# The response address is defined if this is a response.
if (defined $resp_address) {
printf(
"ping to %-15.15s at %10d. pong from %-15.15s in %6.3f sn",
$req_address, $req_time,
$resp_address, $roundtrip_time,
);
return;
}
# Otherwise the timeout period has ended.
printf(
"ping to %-15.15s is done.n", $req_address,
);
}
or
use POE::Component::Client::Ping ":const";
# Post an array ref as the callback to get data back to you
$kernel->post("pinger", "ping", [ "pong", $user_data ]);
# use the REQ_USER_ARGS constant to get to your data
sub got_pong {
my ($request, $response) = @_[ARG0, ARG1];
my $user_data = $request->[REQ_USER_ARGS];
...;
}
<<lessSYNOPSIS
use POE qw(Component::Client::Ping);
POE::Component::Client::Ping->spawn(
Alias => "pingthing", # defaults to "pinger"
Timeout => 10, # defaults to 1 second
Retry => 3, # defaults to 1 attempt
OneReply => 1, # defaults to disabled
Parallelism => 20, # defaults to undef
BufferSize => 65536, # defaults to undef
AlwaysDecodeAddress => 1, # defaults to 0
);
sub some_event_handler {
$kernel->post(
"pingthing", # Post the request to the "pingthing" component.
"ping", # Ask it to "ping" an address.
"pong", # Have it post an answer as a "pong" event.
$address, # This is the address we want to ping.
$timeout, # Optional timeout. It overrides the default.
$retry, # Optional retries. It overrides the default.
);
}
# This is the sub which is called when the session receives a "pong"
# event. It handles responses from the Ping component.
sub got_pong {
my ($request, $response) = @_[ARG0, ARG1];
my ($req_address, $req_timeout, $req_time) = @$request;
my ($resp_address, $roundtrip_time, $resp_time, $resp_ttl) = @$response;
# The response address is defined if this is a response.
if (defined $resp_address) {
printf(
"ping to %-15.15s at %10d. pong from %-15.15s in %6.3f sn",
$req_address, $req_time,
$resp_address, $roundtrip_time,
);
return;
}
# Otherwise the timeout period has ended.
printf(
"ping to %-15.15s is done.n", $req_address,
);
}
or
use POE::Component::Client::Ping ":const";
# Post an array ref as the callback to get data back to you
$kernel->post("pinger", "ping", [ "pong", $user_data ]);
# use the REQ_USER_ARGS constant to get to your data
sub got_pong {
my ($request, $response) = @_[ARG0, ARG1];
my $user_data = $request->[REQ_USER_ARGS];
...;
}
Download (0.013MB)
Added: 2007-04-17 License: Perl Artistic License Price:
920 downloads
POE::Component::Client::AirTunes 0.01
POE::Component::Client::AirTunes is a Perl module with stream music to Airport Express. more>>
POE::Component::Client::AirTunes is a Perl module with stream music to Airport Express.
SYNOPSIS
use POE qw( Component::Client::AirTunes );
POE::Component::Client::AirTunes->new(
host => $ip,
alias => "airtunes",
events => {
connected => connected,
error => error,
done => done,
},
);
$kernel->post(airtunes => volume => 100);
$kernel->post(airtunes => play => "/path/to/foobar.m4a");
$kernel->post(airtunes => stop);
POE::Component::Client::AirTunes is a POE component to stream music files to your Airport Express. This module is a frontend for a command line Airport Express player raop_play, which is included in Airport Express Client, availabe at http://raop-play.sourceforge.net.
See t/01_airtunes.t for more example. This module is ALPHA software and its API might change in the future.
<<lessSYNOPSIS
use POE qw( Component::Client::AirTunes );
POE::Component::Client::AirTunes->new(
host => $ip,
alias => "airtunes",
events => {
connected => connected,
error => error,
done => done,
},
);
$kernel->post(airtunes => volume => 100);
$kernel->post(airtunes => play => "/path/to/foobar.m4a");
$kernel->post(airtunes => stop);
POE::Component::Client::AirTunes is a POE component to stream music files to your Airport Express. This module is a frontend for a command line Airport Express player raop_play, which is included in Airport Express Client, availabe at http://raop-play.sourceforge.net.
See t/01_airtunes.t for more example. This module is ALPHA software and its API might change in the future.
Download (0.003MB)
Added: 2007-01-05 License: GPL (GNU General Public License) Price:
1029 downloads
POE::Component::Pool::Thread 0.015
POE::Component::Pool::Thread is a POE Managed Boss/Worker threadpool. more>>
POE::Component::Pool::Thread is a POE Managed Boss/Worker threadpool.
SYNOPSIS
use POE qw( Component::Pool::Thread );
POE::Component::Pool::Thread->new
( MinFree => 2,
MaxFree => 5,
MaxThreads => 15,
StartThrneads => 5,
Name => "ThreadPool",
EntryPoint => &thread_entry_point,
CallBack => &result_handler,
inline_states => {
_start => sub {
my ($kernel, $heap) = @_[ KERNEL, HEAP ];
# We are inside the component session
$kernel->yield(run => @arguements);
$kernel->post(ThreadPool => run => @arguements);
},
}
);
sub thread_entry_point {
my (@arguements) = @_;
return 1;
}
sub result_handler {
my ($kernel, $result) = @_[ KERNEL, ARG0 ];
$result == 1;
}
This is an expand-on-demand thread pool managed through a POE session in a manner that does not interfer with cooperative multitasking. A single pipe is created, each thread communicates its state to the main process through this pipe. No serialization occurs (these are threads, not child processes), so execution is very fast.
<<lessSYNOPSIS
use POE qw( Component::Pool::Thread );
POE::Component::Pool::Thread->new
( MinFree => 2,
MaxFree => 5,
MaxThreads => 15,
StartThrneads => 5,
Name => "ThreadPool",
EntryPoint => &thread_entry_point,
CallBack => &result_handler,
inline_states => {
_start => sub {
my ($kernel, $heap) = @_[ KERNEL, HEAP ];
# We are inside the component session
$kernel->yield(run => @arguements);
$kernel->post(ThreadPool => run => @arguements);
},
}
);
sub thread_entry_point {
my (@arguements) = @_;
return 1;
}
sub result_handler {
my ($kernel, $result) = @_[ KERNEL, ARG0 ];
$result == 1;
}
This is an expand-on-demand thread pool managed through a POE session in a manner that does not interfer with cooperative multitasking. A single pipe is created, each thread communicates its state to the main process through this pipe. No serialization occurs (these are threads, not child processes), so execution is very fast.
Download (0.007MB)
Added: 2007-04-18 License: Perl Artistic License Price:
920 downloads
Secleted [ 0 ] software to compare
Copyright Notice:
Software piracy is theft, Using crack, password, serial numbers, registration codes, key generators is illegal and prevent future software development. The above poe component enc flac 1.01 search only lists software in full, demo and trial versions for free download. Download links are directly from our mirror sites or publisher sites, torrent files or links from rapidshare.com, yousendit.com or megaupload.com are not allowed