Sprocket::Util::FDpasser - Pass File Descripters using File::FDpasser


Sprocket documentation  | view source Contained in the Sprocket distribution.

Index


NAME

Top

Sprocket::Util::FDpasser - Pass File Descripters using File::FDpasser

SYNOPSIS

Top

    my $passer = Sprocket::Util::FDpasser->new(
        EndpointFile => '/tmp/fdpasser',
        Connect => 0
    );

    $passer->attach_hook( 'sprocket.fdpasser.accept', sub {
        my $event = shift;
        warn "received filehandle: $event->{fh}";
    } );

    # send a file handle
    $passer->send_fd( *STDIN{IO} );

DESCRIPTION

Top

This module provides a session that watches File::FDpasser's filehandle for readability, and emits an event for received file handles.

This module is a subclass of Sprocket::Util::Observable and inherits all of its methods.

METHODS

Top

new

Create a new FD passer object

EndpointFile => (str)

A path to an FDpasser endpoint.

Connect => (true|false)

Connect to (true) or create (false) the endpoint

send_fd( $filehandle )

HOOKS

Top

sprocket.fdpasser.accept

Emitted on $self and $sprocket, in that order. $event->{fh} is the filehandle received.

SEE ALSO

Top

Sprocket, Sprocket::Util::Observable, File::FDpasser

AUTHOR

Top

David Davis <xantus@cpan.org>

COPYRIGHT AND LICENSE

Top


Sprocket documentation  | view source Contained in the Sprocket distribution.