Exobrain - Core Exobrain accessor class
version 0.06
$exobrain->watch_loop( class => 'Measurement::Geo', filter => sub { $_->is_me }, then => sub { ... }, );
When we see packets of a particular class, do a particular thing.
If the optional debug option is passed with a coderef, that will be run for every event in the desired class, before the filter is evaluated.
debug
The event is passed as the first argument to all coderefs. As a convenience, it is also placed inside $_.
$_
Never returns, just runs the loop forever.
$exobrain->notify($msg priority => -1, );
Takes a mandatory message, and any arguments that can be passeed to Exobrain::Intent::Notify, and notifies the user. At the time of writing, notifications are done by the pushover end-point by default.
This is a thin wrapper around $exobrain-intent('Notify', ... >.
$exobrain-
$exobrain->message( ... )->send_msg;
Shortcut to create a 'raw' message. The exobrain parameter will be passed to the class constructor automatically.
$exobrain->measure( 'Mailbox', count => 42, user => 'pjf', server => 'imap.example.com', fodler => 'INBOX', )->send;
Preferred shortcut for creating a measurement of the desired class. The exobrain parameter will be passed to the measurement class constructor automatically.
exobrain
my $intent = $exobrain->intent( 'Tweet', tweet => 'Hello World', );
Preferred shortcut for making an intent of the desired class. The exobrain parameter will be passed to the intent class constructor automatically.
Paul Fenwick <pjf@cpan.org>
This software is copyright (c) 2014 by Paul Fenwick.
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 Exobrain, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Exobrain
CPAN shell
perl -MCPAN -e shell install Exobrain
For more information on module installation, please visit the detailed CPAN module installation guide.