OO::Plugin

Framework for working with OO application plugins

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.141592653589793

DESCRIPTION

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.

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.

SEE ALSO

OO::Plugin::Manual, OO::Plugin::Manager, OO::Plugin::Class OO::Plugin::Registry

ChangeLog

AUTHOR

Vadim Belman [email protected]

OO::Plugin v0.0.8

Framework for working with OO application plugins

Authors

  • Vadim Belman

License

Artistic-2.0

Dependencies

File::FindAsync::Workers

Test Dependencies

Provides

  • OO::Plugin
  • OO::Plugin::Class
  • OO::Plugin::Declarations
  • OO::Plugin::Exception
  • OO::Plugin::Manager
  • OO::Plugin::Metamodel::PlugRoleHOW
  • OO::Plugin::Metamodel::PluginHOW
  • OO::Plugin::Registry

The Camelia image is copyright 2009 by Larry Wall. "Raku" is trademark of the Yet Another Society. All rights reserved.