-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
16 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
# Changelog | ||
|
||
## v.0.24.1 | ||
- Add `Tags` to `IExecutionContext`. | ||
|
||
## v.0.24.0 | ||
- Upgraded to .NET 8. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 6 additions & 10 deletions
16
src/LiteBus.Messaging/Internal/Contexts/Execution/ExecutionContext.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,28 @@ | ||
#nullable enable | ||
|
||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Threading; | ||
using LiteBus.Messaging.Abstractions; | ||
|
||
namespace LiteBus.Messaging.Internal.Contexts.Execution; | ||
|
||
/// <summary> | ||
/// Represents the execution context for a specific operation or task. | ||
/// </summary> | ||
/// <inheritdoc cref="IExecutionContext"/> | ||
internal sealed class ExecutionContext : IExecutionContext | ||
{ | ||
/// <summary> | ||
/// Initializes a new instance of the <see cref="ExecutionContext"/> class with the specified cancellation token. | ||
/// </summary> | ||
/// <param name="cancellationToken">The cancellation token associated with the execution context.</param> | ||
public ExecutionContext(CancellationToken cancellationToken) | ||
public ExecutionContext(CancellationToken cancellationToken, IEnumerable<string> tags) | ||
{ | ||
CancellationToken = cancellationToken; | ||
Tags = tags.ToList(); | ||
} | ||
|
||
/// <summary> | ||
/// Gets the cancellation token associated with the execution context. | ||
/// </summary> | ||
public CancellationToken CancellationToken { get; } | ||
|
||
/// <summary> | ||
/// Gets or sets a key/value collection that can be used to share data within the scope of this execution. | ||
/// </summary> | ||
public IDictionary<object, object?> Items { get; } = new Dictionary<object, object?>(); | ||
|
||
public IReadOnlyCollection<string> Tags { get; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters