![]() |
Y::Notifier - Implementation - Client API | ![]() |
my $handle = new Y::Notifier($host, $port);$host and $port are optional$handle->Register($subject, $sub);$sub takes the recieved message $subject and $body as argument$handle->RegisterTimer($ms, $sub);$sub takes no arguments, $ms is milliseconds$handle->RegisterFileHandle($fh, $sub);$sub takes the line read as argument$handle->RegisterErrorHandler($sub);$sub takes no arguments$handle->Send($subject, $rh_body);$handle->Forget($subject);$handle->Listen($timeout);$handle->Flush();Register* methods will accept an object and a method name to invoke on that objectSend, by virtue of a local (not my) variable, is aware of whether it is being called from inside an event loop (as set up by Listen)write (non-blocking)
![]() |
Y::Notifier - Implementation - Client API | ![]() |