-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix against TimeSpan.Zero for max lifetime #72
Merged
Merged
Changes from 8 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
d15befb
Fix against TimeSpan.Zero for max lifetime
Mpdreamz e011dcf
Move blocking logic to WaitToWrriteAsync and use a more reliable impl…
Mpdreamz 2f6828c
remove dead code
Mpdreamz 1b2f47e
ensure noop export waits signicicantly long to force concurrency
Mpdreamz 183d2e0
model draining before accepting new writes more explicitly
Mpdreamz fbff9be
fix typo
Mpdreamz 55ebdc4
fix tests
Mpdreamz bbf5dc2
Ensure WaitToWriteAsync is deterministic (in that it will not wait fo…
Mpdreamz dd7ae52
revert changes to benchmark project
Mpdreamz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,13 +25,22 @@ public class BufferOptions | |
/// </summary> | ||
public int OutboundBufferMaxSize { get; set; } = 1_000; | ||
|
||
private TimeSpan _outboundBufferMaxLifetime = TimeSpan.FromSeconds(5); | ||
private readonly TimeSpan _outboundBufferMinLifetime = TimeSpan.FromSeconds(1); | ||
|
||
|
||
/// <summary> | ||
/// The maximum lifetime of a buffer to export to <see cref="BufferedChannelBase{TChannelOptions,TEvent,TResponse}.ExportAsync"/>. | ||
/// If a buffer is older then the configured <see cref="OutboundBufferMaxLifetime"/> it will be flushed to | ||
/// <see cref="BufferedChannelBase{TChannelOptions,TEvent,TResponse}.ExportAsync"/> regardless of it's current size | ||
/// <para>Defaults to <c>5 seconds</c></para> | ||
/// <para>Any value less than <c>1 second</c> will be rounded back up to <c>1 second</c></para> | ||
/// </summary> | ||
public TimeSpan OutboundBufferMaxLifetime { get; set; } = TimeSpan.FromSeconds(5); | ||
public TimeSpan OutboundBufferMaxLifetime | ||
{ | ||
get => _outboundBufferMaxLifetime; | ||
set => _outboundBufferMaxLifetime = value >= _outboundBufferMinLifetime ? value : _outboundBufferMaxLifetime; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ensuring we can never set max life time to any thing less then 1s. Otherwise each publish will cause an export, akin to setting |
||
} | ||
|
||
/// <summary> | ||
/// The maximum number of consumers allowed to poll for new events on the channel. | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you mean for this to remain uncommented?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reverted changes to the benchmark project, wasn't needed in this PR 👍