Created
January 16, 2022 19:01
-
-
Save dgafka/abaef32ed247c970dc9776d8189254d0 to your computer and use it in GitHub Desktop.
microservices-integration-in-php-08.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 UserService | |
{ | |
public function __construct(private DistributedBus $distributedBus) {} | |
public function banUser(int $personId, int $executorId): void | |
{ | |
$this->distributedBus->publishEvent( | |
"user.was_banned", | |
\json_encode(["personId" => $personId]), | |
"application/json", | |
["executorId" => $executorId] | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment