Skip to content

Instantly share code, notes, and snippets.

@dgafka
Created September 29, 2022 18:47
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/78116bebc6dae811208bd7f842956188 to your computer and use it in GitHub Desktop.
Save dgafka/78116bebc6dae811208bd7f842956188 to your computer and use it in GitHub Desktop.
loosely-coupled-microservices-02.php
<?php
class NotificationService
{
#[Distributed]
#[EventHandler("order.was_placed")]
public function sendEmail(array $payload): void
{
// send email to $payload["userId"];
}
}
class AuditLogService
{
#[Distributed]
#[EventHandler("order.was_placed")]
public function storeAudit(string $payload): void
{
// store json payload
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment