This library provides an event system for registering specific event handlers. For example, it's used to automatically mount added filesystem components or to run some tasks regularly with specified interval. There's also important interrupting feature for instant killing not responding scripts.
event.interruptingEnabled
Boolean variable that allows to set state of interrupting programs by presssing ctrl + alt + c keystroke
event.pull(...): ...
Works the same way as computer.pullSignal(...) do, but also calls registered event handlers if needed and checks interrupting status:
event.sleep(float delay)
Sleeps delay seconds via busy-wait concept. This method allows event handlers to be processed if any event occurs during sleeping.
event.addHandler(function func[, int interval, int times]): table handler
Registers an event handler wrapper for given function and returns it.
Every registered handler will be analyzed for the need to run during each event.pull() call. When handler is being run, it receives values returned from event.pull() as arguments.
You can specify an interval in seconds between each run of given handler. By default it's set to nil, i.e. handler runs every event.pull() call without any delay.
You can also specify number of times that given handler will be run before being removed automatically. By default it's set to infinity.
event.removeHandler(table handler): boolean success
Tries to unregister created event handler. Returns true if it was registered and false otherwise.