Skip to content

Instantly share code, notes, and snippets.

@dgafka
Created September 24, 2022 08:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dgafka/5b6fa459191828de89437e1b892ea12d to your computer and use it in GitHub Desktop.
Save dgafka/5b6fa459191828de89437e1b892ea12d to your computer and use it in GitHub Desktop.
Working with asynchronous errors in PHP
<?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