Exobrain::Agent - Agent role for Exobrain agents
version 1.08
use Moose; with 'Exobrain::Agent';
This role provides a number of utility methods and attributes to Exobrain agents. Most agents will prefer to use the Exobrain::Agent::Poll or Exobrain::Agent::Run roles instead, and which in turn consume this role and hence provide its functionality.
Where possible, all attributes provided by this role are lazily generated, including lazily loading modules.
$self->exobrain->watch_loop(...);
Returns an Exobrain object.
my $component = $self->component;
Exobrain components all share the same configuration and cache, and are often packaged as separate distributions. This method returns the current component name.
By default this is the same as the class name with 'Exobrain::Agent::' stripped off. Agents and roles which are part of a specific component should override this attribute (or supply their own default).
my $user = $self->config->{user};
Returns the config for our current component. Use $self-exobrain->config> instead if you want the top-level config.
$self-
my $cache = $self->cache;
Returns an Exobrain::Cache object, with a namespace of $self-component>.
my $json = $self->json;
Returns a JSON::Any object.
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.