Myriad::Plugin - extensible Myriad functionality using attributes
The plugin system allows sharing of various features between service implementations. Examples might include database or API access.
Plugins will be loaded automatically if an as-yet-unknown attribute is used.
For example, a hypothetical async method example : Reverse() { } service method definition would attempt to use the registered Reverse handler, and if none was found would proceed to load Myriad::Plugin::Reverse and try again.
async method example : Reverse() { }
Reverse
Myriad::Plugin::Reverse
Example:
has $db; register SQL => async method ($code, %args) { return sub ($srv, @args) { my ($sql, @bind) = $srv->$code(@args); return $db->query( $sql => @bind )->row_hashrefs } };
BUILDARGS
Deriv Group Services Ltd. DERIV@cpan.org.
DERIV@cpan.org
See "CONTRIBUTORS" in Myriad for full details.
Copyright Deriv Group Services Ltd 2020-2022. Licensed under the same terms as Perl itself.
To install Myriad, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Myriad
CPAN shell
perl -MCPAN -e shell install Myriad
For more information on module installation, please visit the detailed CPAN module installation guide.