GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  PADRE::ROLE::PUBSUB (3)

.ds Aq ’

NAME

Padre::Role::PubSub - A simple event publish/subscriber role

CONTENTS

DESCRIPTION

This class allows the addition of simple publish/subscribe behaviour to an arbitrary class.

METHODS

    subscribe



  $publisher->subscriber( $object, {
      my_event_one => my_handler_method,
      my_event_two => my_handler_method,
  } );



The <subscriber> method lets you register an object for callbacks to a particular set of method for various named events.

Returns true, or throws an exception if any of the parameters are invalid.

    unsubscribe



  $publisher->unsubscribe($subscriber);



The unsubscribe method removes all event registrations for a particular object.

Returns true.

    publish



  $publisher->publish("my_event_one", "param1", "param2");



The publish method is called on the published to emit a particular named event.

It calls any registered event handlers in sequence, ignoring exceptions.

Returns true, or throws an exception if the event name is invalid.

COPYRIGHT & LICENSE

Copyright 2008-2013 The Padre development team as listed in Padre.pm.

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

The full text of the license can be found in the LICENSE file included with this module.

Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 PADRE::ROLE::PUBSUB (3) 2013-11-09

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.