Skip to content

Commit

Permalink
chore: few small adjustments to Readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Marco Brotas committed Oct 16, 2023
1 parent 1162260 commit b4452b5
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ Any time an error occurs within the bus, it will be passed on to the error handl
### Middlewares
Middlewares are any type that implements the _InwardMiddleware_ or the _OutwardMiddleware_ interface.
Middlewares are optional and provided to the _Bus_ using the ```bus.SetInwardMiddlewares``` and ```bus.SetOutwardMiddlewares``` functions.
An _InwardMiddleware_ middleware handles every command before it is provided to its respective handler.
An _OutwardMiddleware_ middleware handles every command that was successfully processed by its respective handler. These middlewares are also provided with the data or error returned by the command handler. Allowing potential data/error handling, such as transformations.
An _InwardMiddleware_ handles every command before it is provided to its respective handler.
An _OutwardMiddleware_ handles every command that was successfully processed by its respective handler. These middlewares are also provided with the data or error returned by the command handler. Allowing potential data/error handling, such as transformations.

**The order in which the middlewares are provided to the Bus is always respected. Additionally, if a middleware returns an error, it interrupts the flow and the command is no longer passed along to the next step.**
```go
Expand Down Expand Up @@ -106,11 +106,12 @@ bus.Shutdown()
**This function will block until the bus is fully stopped.**

#### Available Errors
Below is a list of errors that can occur when calling ```bus.HandleAsync or bus.Handle```.
Below is a list of errors that can occur when calling ```bus.Initialize```, ```bus.Handle```, ```bus.HandleAsync``` and ```bus.Schedule```.
```go
command.InvalidCommandError
command.BusNotInitializedError
command.BusIsShuttingDownError
command.OneHandlerPerCommandError
command.HandlerNotFoundError
```

Expand Down

0 comments on commit b4452b5

Please sign in to comment.