Created
September 24, 2022 08:52
-
-
Save dgafka/5b6fa459191828de89437e1b892ea12d to your computer and use it in GitHub Desktop.
Working with asynchronous errors in PHP
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
<?php | |
#[Asynchronous("async")] | |
#[EventHandler] | |
class NotificationServiceHandler | |
{ | |
public function __invoke(OrderWasPlaced $message) | |
{ | |
// send an SMS message! | |
} | |
} | |
#[Asynchronous("async")] | |
#[EventHandler] | |
class PaymentServiceHandler | |
{ | |
public function __invoke(OrderWasPlaced $message) | |
{ | |
// take a payment from credit card | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment