Last active
May 13, 2022 17:34
-
-
Save dgafka/35187a91f8af95a40e183b64743f9003 to your computer and use it in GitHub Desktop.
asynchronous-messaging-11.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 | |
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