Skip to content

Instantly share code, notes, and snippets.

@dgafka
Last active May 13, 2022 06:40
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/9c78a0af850a15b3e97bddaabcacdb27 to your computer and use it in GitHub Desktop.
Save dgafka/9c78a0af850a15b3e97bddaabcacdb27 to your computer and use it in GitHub Desktop.
asynchronous-messaging-04.php
<?php
$bus->dispatch(new PlaceOrder(), [new ExecutorStamp($executorId)]);
(..)
class AuthorizeExecutorMiddleware implements MiddlewareInterface
{
public function handle(Envelope $envelope, StackInterface $stack): Envelope
{
$stamps = $envelope->all(ExecutorStamp::class);
// do something more
return $stack->next()->handle($envelope, $stack);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment