Skip to content

Instantly share code, notes, and snippets.

@dgafka
Last active May 13, 2022 17:34
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/35187a91f8af95a40e183b64743f9003 to your computer and use it in GitHub Desktop.
Save dgafka/35187a91f8af95a40e183b64743f9003 to your computer and use it in GitHub Desktop.
asynchronous-messaging-11.php
<?php
class MessagingConfiguration
{
#[ServiceContext]
public function asyncChannel()
{
// this channel can be reused for different message handlers
return AmqpBackedMessageChannelBuilder::create("async_channel");
}
}
class PlaceOrdernHandler
{
#[Asynchronous("async_channel")]
#[CommandHandler("place_order")]
public function placeOrder(PlaceOrder $message) {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment