Toru Yamaguchi

NAME

MogileFS::Plugin::MultiHook - MogileFS plugins for using multiple hooks

VERSION

version 0.03

SYNOPSIS

In the mogilefsd config,

  plugins = MultiHook Foo

In "MogileFS::Plugin::Foo" plugin,

  MogileFS::register_global_hook("cmd_create_open", sub { Mgd::log("info", "begin cmd_create_open") });
  ### Some process
  MogileFS::register_global_hook("cmd_create_open", sub { Mgd::log("info", "end cmd_create_open") });

DESCRIPTION

This module is plugin for MogileFS::Server to register and use multiple hooks. For using this plugin, you should set plugin name at head of plugins, such as:

  plugins = MultiHook FilePaths

When this module is loaded, MogileFS::register_global_hook() and MogileFS::run_global_hook() will be replaced to what is available to register and use multiple hooks from original. But the arguments has not changed from an original in consideration.

In addition, The register_global_hook() method simpley push a hook to the list of callbacks of each hook and run_global_hook() method will call hooks in order of pushed.

Calling MogileFS::unregister_global_hook() will delete all of callbacks of each specified hook.

METHODS

load()

Calling by MogileFS::Config::load_config() method.

SEE ALSO

MogileFS::Server
MogileFS::Worker::Query
MogileFS::Client
MogileFS::Plugin::MetaData
MogileFS::Plugin::FilePaths

AUTHOR

Toru Yamaguchi, <zigorou@cpan.org>

BUGS

Please report any bugs or feature requests to bug-mogilefs-plugin-multihook@rt.cpan.org, or through the web interface at http://rt.cpan.org. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

COPYRIGHT & LICENSE

Copyright 2007 Toru Yamaguchi, All Rights Reserved.

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