Skip to content

Instantly share code, notes, and snippets.

@dgafka
Last active January 16, 2022 18: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/82c70daeb3a31daa5d8c6bc133663e54 to your computer and use it in GitHub Desktop.
Save dgafka/82c70daeb3a31daa5d8c6bc133663e54 to your computer and use it in GitHub Desktop.
microservices-integration-in-php-07.php
<?php
class UserService
{
public function __construct(private DistributedBus $distributedBus) {}
public function when(UserWasBanned $event): void
{
$distributedBus->convertAndPublishEvent(
"user.was_banned",
$event
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment