Skip to content

Commit 58c6623

Browse files
committed
More minor tweaks to readme
1 parent 9b6ad43 commit 58c6623

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

readme.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ for execution:
8888
| void asynchronous command | `IAsyncCommand` | `await IMessageBus.ExecuteAsync(command)` |
8989
| value-returning asynchronous command | `IAsyncCommand<TResult>` | `var result = await IMessageBus.ExecuteAsync(command)` |
9090

91-
The above command can be executed using the following code:
91+
The sample command shown before can be executed using the following code:
9292

9393
```csharp
9494
// perhaps a method invoked when a user
@@ -276,14 +276,20 @@ builder.Services.AddMessageBus();
276276

277277
All command handlers and event producers need to be registered with the
278278
services collection as usual, using the main interface for the component,
279-
such as `ICommandHandler<T>` and `IObservable<TEvent>`.
279+
such as `ICommandHandler<T>` and `IObservable<TEvent>`.
280+
281+
> NOTE: *Merq* makes no assumptions about the lifetime of the registered
282+
> components, so it's up to the consumer to register them with the desired
283+
> lifetime.
280284

281285
To drastically simplify registration of handlers and producers, we
282286
recommend the [Devlooped.Extensions.DependencyInjection.Attributed](https://www.nuget.org/packages/Devlooped.Extensions.DependencyInjection.Attributed/).
283287
package, which provides a simple attribute-based mechanism for automatically
284288
emitting at compile-time the required service registrations for all types
285289
marked with the provided `[Service]` attribute, which also allows setting the
286-
component lifetime, such as `[Service(ServiceLifetime.Transient)]`.
290+
component lifetime, such as `[Service(ServiceLifetime.Transient)]` (default
291+
lifetime is `ServiceLifetime.Singleton` for this source generator-based
292+
package).
287293

288294
This allows to simply mark all command handlers and event producers as
289295
`[Service]` and then register them all with a single line of code:
@@ -328,7 +334,7 @@ dotnet counters monitor --process-id [PROCESS_ID] --counters Merq
328334

329335
Example rendering from the included sample console app:
330336

331-
![dotnet-counters screenshot](https://github.com/devlooped/Merq/blob/main/assets/img/dotnet-counters.png)
337+
![dotnet-counters screenshot](https://github.com/devlooped/Merq/blob/main/assets/img/dotnet-counters.png?raw=true)
332338
333339
## Duck Typing Support
334340

0 commit comments

Comments
 (0)