POE::Component::Generic 0.0904
Sponsored Links
POE::Component::Generic 0.0904 Ranking & Summary
File size:
0.030 MB
Platform:
Any Platform
License:
Perl Artistic License
Price:
Downloads:
1229
Date added:
2006-06-12
Publisher:
David Davis and Teknikill Software
POE::Component::Generic 0.0904 description
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.
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
# 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.
POE::Component::Generic 0.0904 Screenshot
Advertisements
POE::Component::Generic 0.0904 Keywords
POE
Generic 0.0904
STDERR
POE Component
access to
object
optional
option
child
session
provides
POE::Component::Generic
POEComponentGeneric
POE::Component::Generic 0.0904
Libraries
Programming
Bookmark POE::Component::Generic 0.0904
POE::Component::Generic 0.0904 Copyright
WareSeeker periodically updates pricing and software information of POE::Component::Generic 0.0904 full version from the publisher, so some information may be slightly out-of-date. You should confirm all information before relying on it. Software piracy is theft, Using crack, password, serial numbers, registration codes, key generators is illegal and prevent future development of POE::Component::Generic 0.0904 Edition. Download links are directly from our publisher sites, torrent files or links from rapidshare.com, yousendit.com or megaupload.com are not allowed
Featured Software
Want to place your software product here?
Please contact us for consideration.
Contact WareSeeker.com
Related Information
optional practical training
object lessons
poe component client msn
hidden object games
objectives for resumes
poe component irc
objective
object desktop
sample resume objectives
poe component shutdown
objection
object relations theory
myspace falling objects
objectdock
object pronouns
poe component server tcp
object dock
indirect object
Related Software
POE::Component::Growl provides a Growl notification dispatcher for POE. Free Download
POE::Component::YahooMessenger is a POE component for Yahoo! Messenger. Free Download
POE::Component::OSCAR is a POE component for the Net::OSCAR module. Free Download
POE::Component::Basement provides Class::Std and base POE component functionality. Free Download
POE::Component::Server::IRC is a fully event-driven networkable IRC server daemon module. Free Download
POE::Component::Player::Xmms is a wrapper for the Xmms player. Free Download
POE::Component::Enc::Flac is a POE component to wrap FLAC encoder flac. Free Download
POE::Component::Server::HTTP is a foundation of a POE HTTP Daemon. Free Download
Latest Software
Popular Software
Favourite Software
- POE::Component::ControlPort::DefaultCommands 0.01
- POE::Component::Player::Musicus 1.32
- POE::Component::Server::Syslog 1.03
- POE::Component::Player::Slideshow 1.4
- POE::Component::ControlPort::Command 0.01
- POE::Component::DebugShell::Jabber 0.04
- POE::Component::Client::AirTunes 0.01
- POE::Component::ControlPort 0.01