IO::Event::Callback(3pm)

IO::Event::Callback3pm

Usage

 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);

Overview

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.

Examples

 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
        },
 );

Releases

5 releases since Debian 9 (Stretch); the text changed 2 times.

  1. 9–11
  2. 12
  3. 13

From libio-event-perl 0.813-4 in Debian 13 (Trixie). Parsed by carta from the page's man source.