-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Maxime Rainville
committed
Dec 2, 2024
1 parent
e33f638
commit 0c755ac
Showing
4 changed files
with
90 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -60,3 +60,17 @@ function () use ($event) { | |
$event = new UserCreatedEvent('789', '[email protected]'); | ||
$future = $dispatcher->dispatch($event, new TimeoutCancellation(30)); | ||
EventLoop::run(); | ||
|
||
// Set up logging for your dispatcher - all errors will be logged to PSR logger | ||
$logger = new ColinODell\PsrTestLogger\TestLogger(); | ||
$dispatcher = new AsyncEventDispatcher( | ||
$listenerProvider, | ||
$logger | ||
); | ||
|
||
// Let errors bubble up. Useful for unit testing and debugging. | ||
$dispatcher = new AsyncEventDispatcher( | ||
$listenerProvider, | ||
$logger, | ||
AsyncEventDispatcher::THROW_ON_ERROR | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters