Skip to content

Commit dd3954f

Browse files
committed
add quick tour for async event dispatcher.
1 parent 3acd81c commit dd3954f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

AsyncListener.php

+6-1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@ public function __construct(PsrContext $context, Registry $registry, $eventQueue
4040
$this->eventQueue = $eventQueue instanceof PsrQueue ? $eventQueue : $context->createQueue($eventQueue);
4141
}
4242

43+
public function __invoke(Event $event, $eventName)
44+
{
45+
$this->onEvent($event, $eventName);
46+
}
47+
4348
public function resetSyncMode()
4449
{
4550
$this->syncMode = [];
@@ -67,7 +72,7 @@ public function isSyncMode($eventName)
6772
* @param Event $event
6873
* @param string $eventName
6974
*/
70-
public function onEvent(Event $event = null, $eventName)
75+
public function onEvent(Event $event, $eventName)
7176
{
7277
if (false == isset($this->syncMode[$eventName])) {
7378
$transformerName = $this->registry->getTransformerNameForEvent($eventName);

0 commit comments

Comments
 (0)