Skip to content

Commit

Permalink
Merge pull request #17 from php-fig/stoppable-thin
Browse files Browse the repository at this point in the history
Remove stopPropagation() method.
  • Loading branch information
WyriHaximus authored Sep 15, 2018
2 parents 4328733 + ca47d6e commit 03e2fb6
Showing 1 changed file with 6 additions and 16 deletions.
22 changes: 6 additions & 16 deletions src/StoppableTaskInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,23 @@
namespace Psr\EventDispatcher;

/**
* Event that can stop propagation to undispatched listeners.
* A Task whose processing may be interrupted when the task is complete.
*
* A Stoppable Dispatcher implementation MUST check to determine if an Event
* A Processor implementation MUST check to determine if a Task
* is marked as stopped after each listener is called. If it is then it should
* return immediately without calling any further Listeners.
*/
interface StoppableTaskInterface extends TaskInterface
{
/**
* Stop event propagation.
*
* Once called, when handling returns to the dispatcher, the dispatcher MUST
* stop calling any remaining listeners and return handling back to the
* target object.
*
* @return self
*/
public function stopPropagation() : self;

/**
* Is propagation stopped?
*
* This will typically only be used by the dispatcher to determine if the
* This will typically only be used by the Processor to determine if the
* previous listener halted propagation.
*
* If stopPropagation() has previously been called then this method MUST
* return true. If not, it may return true or false as appropriate.
* @return bool
* True if the Task is complete and no further listeners should be called.
* False to continue calling listeners.
*/
public function isPropagationStopped() : bool;
}

0 comments on commit 03e2fb6

Please sign in to comment.