Class ZaminInboxStore
Implements IInboxStore using Zamin's native InboxMessage table and Zamin.Infra.Data.Sql.Commands.BaseCommandDbContext.
Implements
Inherited Members
Namespace: Chapar.Zamin.Outbox.Inbox
Assembly: Chapar.Zamin.Outbox.dll
Syntax
public sealed class ZaminInboxStore : IInboxStore
Constructors
| Edit this page View SourceZaminInboxStore(BaseCommandDbContext)
Initializes a new instance of the ZaminInboxStore class.
Declaration
public ZaminInboxStore(BaseCommandDbContext dbContext)
Parameters
| Type | Name | Description |
|---|---|---|
| BaseCommandDbContext | dbContext | The Zamin command database context. |
Methods
| Edit this page View SourceMarkAsProcessedAsync(InboxMessage, CancellationToken)
Marks a previously reserved message as completely processed. Called only after the handler has finished without exception.
Declaration
public Task<bool> MarkAsProcessedAsync(InboxMessage message, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| InboxMessage | message | The inbox message record that should be updated. |
| CancellationToken | cancellationToken | Cancellation token. |
Returns
| Type | Description |
|---|---|
| Task<bool> |
|
TryReserveAsync(string, string, CancellationToken)
Attempts to atomically reserve an incoming message for processing.
When the method returns true the caller is the exclusive processor of the message;
when it returns false the message has already been reserved by another consumer.
Declaration
public Task<bool> TryReserveAsync(string messageId, string consumerTypeName, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | messageId | The unique identifier of the incoming message. |
| string | consumerTypeName | The fully qualified type name of the consumer that will handle the message. |
| CancellationToken | cancellationToken | Cancellation token. |
Returns
| Type | Description |
|---|---|
| Task<bool> |
|