Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vrurg/raku-oo-plugin
Perl6 powerful plugins support framework
https://github.com/vrurg/raku-oo-plugin
Last synced: 18 days ago
JSON representation
Perl6 powerful plugins support framework
- Host: GitHub
- URL: https://github.com/vrurg/raku-oo-plugin
- Owner: vrurg
- Created: 2018-12-17T02:39:00.000Z (about 6 years ago)
- Default Branch: main
- Last Pushed: 2021-10-08T23:39:30.000Z (over 3 years ago)
- Last Synced: 2024-11-05T22:44:37.481Z (2 months ago)
- Language: Perl 6
- Size: 247 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: ChangeLog.md
Awesome Lists containing this project
README
NAME
====OO::Plugin – framework for working with OO plugins.
SYNOPSIS
========use OO::Plugin;
use OO::Plugin::Manager;class Foo is pluggable {
has $.attr;
method bar is pluggable {
return 42;
}
}plugin Fubar {
method a-bar ( $msg ) is plug-around( Foo => 'bar' ) {
$msg.set-rc( pi ); # Will override &Foo::bar return value and prevent its execution.
}
}my $manager = OO::Plugin::Manager.new.initialize;
my $instance = $manager.create( Foo, attr => 'some value' );
say $instance.bar; # 3.141592653589793DESCRIPTION
===========With this framework any application can have highly flexible and extensible plugin subsystem with which plugins would be capable of:
* method overriding
* class overriding (inheriting)
* callbacks
* asynchronous event handling
The framework also supports:
* automatic loading of plugins with a predefined namespace
* managing plugin ordering and dependencies
Not yet supported but planned for the future is plugin compatibility management.
Read more in [`OO::Plugin::Manual`](Plugin/Manual.md).
EXPORTS
=======Routines
--------* `plugin-meta [key =` value, ...]>
Registers plugin meta. Can only be used within plugin body block.
* `plug-last [return-value]`
Cancels current execution chain and optionally sets return value.
* `plug-redo`
Restarts current execution chain.
Classes
-------`PluginMessage` and are re-exported from [`OO::Plugin::Class`](Plugin/Class.md).
SEE ALSO
========[`OO::Plugin::Manual`](Plugin/Manual.md), [`OO::Plugin::Manager`](Plugin/Manager.md), [`OO::Plugin::Class`](Plugin/Class.md) [`OO::Plugin::Registry`](Plugin/Registry.md)
[ChangeLog](ChangeLog.md)
AUTHOR
======Vadim Belman