Giter VIP home page Giter VIP logo

module-pluggable-ordered's Introduction

NAME
    Module::Pluggable::Ordered - Call module plugins in a specified order

SYNOPSIS
        package Foo;
        use Module::Pluggable::Ordered;

        Foo->call_plugins("some_event", @stuff);

    Meanwhile, in a nearby module...

        package Foo::Plugin::One;
        sub some_event_order { 99 } # I get called last of all
        sub some_event { my ($self, @stuff) = @_; warn "Hello!" }

    And in another:

        package Foo::Plugin::Two;
        sub some_event_order { 13 } # I get called relatively early
        sub some_event { ... }

DESCRIPTION
    This module behaves exactly the same as "Module::Pluggable", supporting
    all of its options, but also mixes in the "call_plugins" method to your
    class. "call_plugins" acts a little like "Class::Trigger"; it takes the
    name of a method, and some parameters. Let's say we call it like so:

        __PACKAGE__->call_plugins("my_method", @something);

    "call_plugins" looks at the plugin modules found using
    "Module::Pluggable" for ones which provide "my_method_order". It sorts
    the modules numerically based on the result of this method, and then
    calls "$_->my_method(@something)" on them in order. This produces an
    effect a little like the System V init process, where files can specify
    where in the init sequence they want to be called.

SEE ALSO
    Module::Pluggable, Class::Trigger

AUTHORS
    Simon Cozens, <[email protected]> (author emeritus)
    Christopher Nehren, <[email protected]> (current maintainer)

COPYRIGHT AND LICENSE
    Copyright 2004 by Simon Cozens
    Copyright 2004 by Christopher Nehren (current copyright holder)

    This library is free software; you can redistribute it and/or modify it
    under the same terms as Perl itself.

ACKNOWLEDGEMENTS
	Thanks to Simon Cozens for originally writing this module.

module-pluggable-ordered's People

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.