-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: handle race condition in BatchSequence with timeout
- Loading branch information
1 parent
b6894f6
commit 0a255b0
Showing
11 changed files
with
121 additions
and
59 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
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
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
33 changes: 33 additions & 0 deletions
33
src/Silverback.Integration/Messaging/Sequences/AddToSequenceResult.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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// Copyright (c) 2020 Sergio Aquilini | ||
// This code is licensed under MIT license (see LICENSE file for details) | ||
|
||
namespace Silverback.Messaging.Sequences | ||
{ | ||
/// <summary> | ||
/// Encapsulates the result of the <see cref="ISequence.AddAsync" /> method. | ||
/// </summary> | ||
/// <param name="IsSuccess"> | ||
/// A value indicating whether the operation was successful or not. | ||
/// </param> | ||
/// <param name="PushedStreamsCount"> | ||
/// The number of streams that have been actually pushed. | ||
/// </param> | ||
public record AddToSequenceResult(bool IsSuccess, int PushedStreamsCount) | ||
{ | ||
/// <summary> | ||
/// Gets a static instance representing a failed call to <see cref="ISequence.AddAsync" />. | ||
/// </summary> | ||
public static AddToSequenceResult Failed { get; } = new(false, -1); | ||
|
||
/// <summary> | ||
/// Returns a new instance representing a successful call to <see cref="ISequence.AddAsync" />. | ||
/// </summary> | ||
/// <param name="pushedStreams"> | ||
/// The number of streams that have been actually pushed. | ||
/// </param> | ||
/// <returns> | ||
/// The <see cref="AddToSequenceResult" />. | ||
/// </returns> | ||
public static AddToSequenceResult Success(int pushedStreams) => new(true, pushedStreams); | ||
} | ||
} |
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
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
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