GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
IO::Event::Callback(3) User Contributed Perl Documentation IO::Event::Callback(3)

 IO::Event::Callback - A closure based API for IO::Event

 use IO::Event::Callback;

 IO::Event::Callback->new($filehanle, %callbacks);

 use IO::Event::INET::Callback;

 IO::Event::INET::Callback->new(%socket_info, %callbacks);

 use IO::Event::UNIX::Callback;

 IO::Event::UNIX::Callback->new(%socket_info, %callbacks);

IO::Event::Callback is a wrapper around IO::Event. It provides an alternative interface to using IO::Event.

Instead of defining a class with methods like "ie_input", you provide the callbacks as code references when you create the object.

The keys for the callbacks are the same as the callbacks for IO::Event with the "ie_" prefix removed.

 use IO::Event::Callback;

 my $remote = IO::Event::Callback::INET->new(
        peeraddr        => '10.20.10.3',
        peerport        => '23',
        input           => sub { 
                # handle input
        },
        werror          => sub {
                # handdle error
        },
        eof             => sub {
                # handle end-of-file
        },
 );

See the source for RPC::ToWorker for an exmaple use of IO::Event::Callback.
2011-02-01 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.