Created
September 29, 2022 18:47
-
-
Save dgafka/78116bebc6dae811208bd7f842956188 to your computer and use it in GitHub Desktop.
loosely-coupled-microservices-02.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 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