This package provides four interfaces for messaging: Message
, Command
, Event
and Call
.
composer require thesis/message
use Thesis\Message\Call;
use Thesis\Message\Command;
use Thesis\Message\Event;
final readonly class RegisterUser implements Command
{
public function __construct(
public Uuid $userId,
public string $name,
) {}
}
final readonly class UserRegistered implements Event
{
public function __construct(
public Uuid $userId,
) {}
}
/**
* @implements Call<string>
*/
final readonly class GetUserName implements Call
{
public function __construct(
public Uuid $userId,
) {}
}