App::PerlWatcher::Watcher - Observes some external source of events and emits the result of polling them
version 0.16
Holds an reference to engine config (used in construction watcher's thresholds_map)
Remembers the arguments for watcher construction (used in construction watcher's thresholds_map and unique_id)
The wacher configuration hash ref.
Represents watchers unique_id, calculated from concrete watcher class and watcher's config. The unique_id is overloaded "to-string" operation, so watcher can be used to as hash key. unique_id is also used when the PerlWatcher state is been persisted : the watcher itself isn't stored, but it's unique_id is stored. That guarantees that unique_id is the same between PerlWatcher invokations (that's why the perl internal hash funciton isn't used)
Stores current wacher state (memory). When the watcher is persisted, only it's memory and unique_id are stored.
The subroutine reference, which is been called on every poll of watcher external source. It's argument is the State.
The watcher guard returned by AnyEvent->io, AnyEvent->timer etc, with is an core under wich the Watcher is been build.
The method is responsible for building watcher_guard
Immediatly polls the watched object.
Turns on and off the wacher.
Starts the watcher, which will emit it's statuses. The watcher will start only it is active.
Calculates the thresholds_map based on the left map and righ map The left map has precedence. Usualy the left map is the watchers config, while the righ map is the generic PerlWatcher/Engine config
This method interprets the result of poll (true or false) in accordance with thresholds_map and the callback will be called with the resulting status (and optionally provided items). Meant to be called from subclases, e.g.
$watcher->interpret_result(0, $callback);
Ivan Baidakou <dmol@gmx.com>
This software is copyright (c) 2013 by Ivan Baidakou.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install App::PerlWatcher::Engine, copy and paste the appropriate command in to your terminal.
cpanm
cpanm App::PerlWatcher::Engine
CPAN shell
perl -MCPAN -e shell install App::PerlWatcher::Engine
For more information on module installation, please visit the detailed CPAN module installation guide.