=pod
=head1 Zoidberg::Monitor
The monitor subsystem can be used for running applets inside the zoid.
These applets have the following properties:
=over 4
=item B<name:>
Unique name used to identify the applet
=item B<event:>
The event used to trigger the applet
=item B<condition:>
A subroutine which does arbitrary voodoo to decide whether to
return true
=item B<action:>
A subroutine that acts when the condition is true (notify user,
kill process, turn off lights :) )
=back
To get a list of running applets type:
C<-E<gt>Monitor-E<gt>list>
You can register a new applet using the following syntax:
C<-E<gt>Monitor-E<gt>add_applet("foo", "bar" , sub1, sub2)>
"foo" a name
"bar" a event
sub1 the condition as perl code
sub2 the action as perl code
For example:
C<-E<gt>Monitor-E<gt>add_applet('motz', 'precmd', 'int(rand 6) ? 0: 1', '$_[0]-E<gt>parent-E<gt>motz-E<gt>fortune')>
Or delete an applet:
C<-E<gt>Monitor-E<gt>delete_applet("foo")>
=cut