The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Net::PSYC::Event - Event wrapper for different event systems.

DESCRIPTION

Net::PSYC::Event offers an interface to easily use Net::PSYC with different Event systems. It currently offers support for Event, IO::Select and Gtk2.

SYNOPSIS

    # load Net::PSYC::Event for Gtk2 eventing.
    use Net::PSYC qw(Event=Gtk2);
    use Net::PSYC::Event qw(registerPSYC unregisterPSYC startLoop);

    bindPSYC('psyc://myfunkyhostname/');
    registerPSYC('psyc://myfunkyhostname/@chatroom');
 
    sub msg {
        my ($source, $mc, $data, $vars) = @_;
        # lets do some conferencing
    }

    startLoop() # start the event-loop
 

PERL API

registerPSYC( $unl[, $object ] )

Registers $object or the calling package for all incoming messages targeted at $unl. Calls

$object->msg( $source, $mc, $data, $vars ) or

caller()::msg( $source, $mc, $data, $vars )

for every incoming PSYC packet.

unregisterPSYC( $unl )

Unregister an $unl. No more packages will be delivered for that $unl thenceforward.

startLoop()

Start the Event loop.

stopLoop()

Stop the Event loop.

add( $fd, $flags, $callback[, $repeat])

Start watching for events on $fd. $fd may be a GLOB or an IO::Handle object. $flags may be r, w or e (data to be read, written or pending exceptions) or any combination.

If $repeat is set to 0 the callback will only be called once (revoke() may be used to reactivate it). If you don't want one-shot events either leave $repeat out or set it to 1.

revoke( $fd )

Revokes the eventing for $fd. ( one-shot events )

remove( $fd[, $flags] )

Stop watching for events on $fd. Different types can not be removed seperately if they have been add()ed together!

SEE ALSO

Net::PSYC, Net::PSYC::Client, Net::PSYC::Event::Event, Net::PSYC::Event::IO_Select, Net::PSYC::Event::Gtk2, http://psyc.pages.de/

AUTHORS

Arne Gödeke <el@goodavice.pages.de>

COPYRIGHT

Copyright (c) 2003-2004 Arne Gödeke. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.