NAME

Future::IO::ImplBase - base class for Future::IO implementations

DESCRIPTION

This package provides a few utility methods that may help writing actual Future::IO implementation classes. It is entirely optional; implementations are not required to use it.

CLASS METHODS

APPLY

__PACKAGE__->APPLY;

Attempts to set the value of the $Future::IO::IMPL variable to the name of the calling package.

DEFAULT METHODS

These methods are provided based on lower-level functionallity that the implementing class should provide.

accept

Implemented by wrapping poll(POLLIN), as "sysread" uses.

alarm

Implemented by wrapping sleep.

connect

Implemented by wrapping poll(POLLOUT), as "syswrite" uses.

recv

recvfrom

Implemented by wrapping poll(POLLIN), as "sysread" uses.

send

Implemented by wrapping poll(POLLOUT), as "syswrite" uses.

sysread

Requires a lower-level method

$f = $class->poll( $fh, POLLIN );

which should return a Future that completes when the given filehandle may be ready for reading.

syswrite

Requires a lower-level method

$f = $class->poll( $fh, POLLOUT );

which should return a Future that completes when the given filehandle may be ready for writing.

LEGACY METHODS

The following methods are not considered part of the official Future::IO implementation API, and should not be relied upon when writing new code. However, existing code may still exist that uses them so for now they are provided as wrappers.

Later versions of this module may start printing deprecation warnings on these methods, so existing code ought to be updated to use the newer forms now.

ready_for_read

ready_for_write

$f = $class->ready_for_read( $fh );

$f = $class->ready_for_write( $fh );

Implemented by wrapping poll by passing in the POLLIN or POLLOUT flags respectively.

AUTHOR

Paul Evans <leonerd@leonerd.org.uk>