diff --git a/README.md b/README.md index ca3d00e..93dd71f 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ composer require open-solid/bus ### Dispatching Message with the Bus Think of the "bus" as a mail delivery system for your messages. It follows a specific path, decided -by some rules (middleware), to send your messages. +by some rules (middleware), to send your message and handle it. Here's a snippet on how to set it up and dispatch a message: diff --git a/src/Envelope/Message.php b/src/Envelope/Message.php index 54a1fe2..1a55ba8 100644 --- a/src/Envelope/Message.php +++ b/src/Envelope/Message.php @@ -13,6 +13,9 @@ namespace OpenSolid\Bus\Envelope; +/** + * A data structure that represents a message to be dispatched by a bus to its handlers. + */ abstract readonly class Message { } diff --git a/src/Envelope/Stamp/HandledStamp.php b/src/Envelope/Stamp/HandledStamp.php index d8ea7df..bd40996 100644 --- a/src/Envelope/Stamp/HandledStamp.php +++ b/src/Envelope/Stamp/HandledStamp.php @@ -13,6 +13,9 @@ namespace OpenSolid\Bus\Envelope\Stamp; +/** + * A stamp that marks the message as handled. + */ final readonly class HandledStamp extends Stamp { public function __construct( diff --git a/src/Envelope/Stamp/Stamp.php b/src/Envelope/Stamp/Stamp.php index 856d5af..53e43d9 100644 --- a/src/Envelope/Stamp/Stamp.php +++ b/src/Envelope/Stamp/Stamp.php @@ -13,6 +13,10 @@ namespace OpenSolid\Bus\Envelope\Stamp; +/** + * A stamp is a marker that can be used to store metadata and take decisions + * during the message journey. + */ abstract readonly class Stamp { } diff --git a/src/Envelope/Stamp/Stamps.php b/src/Envelope/Stamp/Stamps.php index e6afd02..bda5ff0 100644 --- a/src/Envelope/Stamp/Stamps.php +++ b/src/Envelope/Stamp/Stamps.php @@ -13,6 +13,9 @@ namespace OpenSolid\Bus\Envelope\Stamp; +/** + * A collection of stamps. + */ final class Stamps implements \Countable { /**