waitNextEvent

Name

waitNextEvent -- Waits the specified number of seconds, or until an event occurs.

Synopsis

$err = $mod->waitNextEvent($secs);

Description

Waits the specified number of seconds for an event. If the RSPD is down or is in the process of shutting down, the function returns immediately and sets the error code. Otherwise, this function returns with no event (0) and lets your module do an update.

Returns

This functions returns 0 if no event happened and the program may continue. If the RSPD has shutdown or if there is another error, -1 is returned. In this case your module should exit as soon as possible. In case of error, the program will croak() with an appriopriate message.