NAME
Base abstract class for all handle types
SYNOPSIS
# since Handle is abstract, only concrete class can be instantiated
my $h = UniEvent::Timer->new;
$h->loop; # event loop is returned, the default one in the case
$h->type; # UniEvent::Timer::TYPE
say $h->active; # => false
$h->start;
say $h->active; # => true
$h->weak(1); # make it weak
$h->reset;
$h->clear;
DESCRIPTION
The class contains methods, shared for all hanlde types.
METHODS
loop()
Returns assigned to the handle event loop instance.
type()
Returns an integer, which uniquely identifies handle type (e.g. UniEvent::Timer::TYPE).
active()
Returns true if the handle is "active". What "active" means depends on the concrete handle type, i.e. for timer hanlde active means, that it was started, for pipe, tcp etc. handle types "active" means that I/O operations will be performed.
Usually, if there is a start()
method, then handle is active afther the invokation of the method, and vise versa, stop()
method deactivates handle.
weak([$value = false])
Marks the handle as weak (if $value
is true) or unmarks it (if value is defined and false).
Under the hood it increments/decrements refcounter for the backend handler.
The freshly created handle instance is non-weak (strong) by default.
reset()
Cancels (stops) the handle, resetting it to initial state, with the exception, that assigned callbacks are kept.
clear()
Resets everything, including assigned callbacks, as if the hanle has been created anew.