Technology itself is based on Utils::SmartCallbackList that is part of AI 2008 Project and used by AI::EnvironmentQueue
Technical Details:
System is based on Rules, callback function will run only when all the Rules will return 1;
Utils::SmartCallbackList->call function get a parameter: object
Object is a simple hash with no nested structures.
Example:
Adding new Callback with rules:
Code: Select all
my $rules = [(object => "obj_name1", type => "eq", against=> "something"),
(object => "obj_name2", type => "==", against=> 1)];
$SmartCallbackList->add($self, $rules, \&some_func, undef);
my $rules2 = [(object => "obj_name1", type => "eq", against=> "something new"),
(object => "obj_name2", type => "==", against=> 1)];
$SmartCallbackList->add($self, $rules2, \&some_func2, undef);
Code: Select all
my %check;
%check{obj_name1} = "something";
%check{obj_name2} = 1;
$SmartCallbackList->call($self, \%check);
All Questions and Suggestions are Welcome.