Data-Context
view release on metacpan or search on metacpan
lib/Data/Context/Manual.pod view on Meta::CPAN
is used to call against C<MODULE>.
If both C<MODULE> and C<METHOD> are specified then C<MODULE>->C<METHOD> is
used.
The contents of the hash containing C<MODULE> and/or C<METHOD> are passed to
the method, along with the C<vars> the request was called with, the dotted
path thought the config and a reference to the L<Data::Context::Instance>
object. The return value of the call is used to replace the original hash
value. That is unless the returned value is an L<AnyEvent::CondVar> variable.
If the result is a condvar then it will be recv()ed allowing for multiple
longer running events to occur. The result of the recv() (ie what is passed
to the ->send) is used to replace the original hash.
=head3 Ordering
The default order that actions are called is the reverse of the order that
they are encountered. This allows an action to include the output of
another action. If this ordering is not what the application requires, the
hash where the action is defined can specify C<ORDER> to overwrite the
default order. If C<ORDER> is a positive integer (including 0) then the
method will be called before other non ordered methods (but in increasing
numerical order by C<ORDER>). If the value is negative then it will be
run after all non ordered actions (again negative C<ORDER>s will be run in
increasing numerical order ie most negative to lease negative).
eg data.dc.yml
actions:
-
METHOD: get_unordered_second
-
METHOD: get_second
ORDER: 1
-
METHOD: get_first
ORDER: 0
-
METHOD: get_unordered_first
-
METHOD: get_last
ORDER: -1
-
METHOD: get_last_but1
ORDER: -2
This will execute in order
get_first
get_second
get_unordered_first
get_unordered_second
get_last_but1
get_last
=head3 How Actions are called
=head3 NEW
Still to be implemented. Currently all method calls are class calls but the
C<NEW> key will be used to specify creating an object.
=head1 BUGS AND LIMITATIONS
There are no known bugs in this module.
Please report problems to Ivan Wills (ivan.wills@gmail.com).
Patches are welcome.
=head1 AUTHOR
Ivan Wills - (ivan.wills@gmail.com)
=head1 LICENSE AND COPYRIGHT
Copyright (c) 2012 Ivan Wills (14 Mullion Close, Hornsby Heights, NSW Australia 2077).
All rights reserved.
This module is free software; you can redistribute it and/or modify it under
the same terms as Perl itself. See L<perlartistic>. This program is
distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
=cut
( run in 0.721 second using v1.01-cache-2.11-cpan-39bf76dae61 )