logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

"Event::Distributor::_Event" - base class for Event::Distributor events

Author

       Paul Evans <leonerd@leonerd.org.uk>

perl v5.32.1                                       2021-09-29                    Event::Distributor::_Event(3pm)

Description

       This class is the base from which the following actual classes are derived:

       • Event::Distributor::Signal

       • Event::Distributor::Query

       Instances  of  this  class  shouldn't  be directly created by end-user code, but it is documented here in
       order to list the shared methods available on all the subclasses.

Expected Methods

       Subclasses are expected to implement the following methods:

   fire
          $f = $event->fire( @args )

       Invoked  by  Event::Distributor  to  actually  run  the  signal.  This  is  expected to invoke any or all
       subscribers in whatever manner it implements, passing arguments as required, and  collecting  results  in
       some way to provide as the eventual answer of the Future it returns.

Methods

subscribe
          $event->subscribe( $code )

       Adds a new "CODE" reference that subscribes to the event. This  code  is  expected  to  return  a  Future
       instance.

   subscribers
          @codes = $event->subscribers

       Returns a list of "CODE" references previously subscribed.

Name

       "Event::Distributor::_Event" - base class for Event::Distributor events

See Also