-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make timers typed, fix NonReentrantGrainTimer change logic
- Loading branch information
1 parent
2767c63
commit 47bfa8b
Showing
9 changed files
with
153 additions
and
96 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
36 changes: 36 additions & 0 deletions
36
src/Orleans.Core.Abstractions/Timers/TimerCreationOptions.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,36 @@ | ||
#nullable enable | ||
using System; | ||
using System.Threading; | ||
|
||
namespace Orleans.Runtime; | ||
|
||
/// <summary> | ||
/// Options for registering grain timers. | ||
/// </summary> | ||
public readonly struct TimerCreationOptions() | ||
{ | ||
/// <summary> | ||
/// The amount of time to delay before the timer callback is invoked. | ||
/// Specify <see cref="Timeout.InfiniteTimeSpan"/> to prevent the timer from starting. | ||
/// Specify <see cref="TimeSpan.Zero"/> to invoke the callback promptly. | ||
/// </summary> | ||
public required TimeSpan DueTime { get; init; } | ||
|
||
/// <summary> | ||
/// The time interval between invocations of callback. | ||
/// Specify <see cref="Timeout.InfiniteTimeSpan"/> to disable periodic signaling. | ||
/// </summary> | ||
public TimeSpan Period { get; init; } = Timeout.InfiniteTimeSpan; | ||
|
||
/// <summary> | ||
/// Gets a value indicating whether callbacks scheduled by this timer are allowed to interleave execution with other timers and grain calls. | ||
/// Defaults to <see langword="false"/>. | ||
/// </summary> | ||
/// <remarks> | ||
/// If this value is <see langword="false"/>, the timer callback will be treated akin to a grain call. If the grain scheduling this timer is reentrant | ||
/// (i.e., it has the <see cref="Concurrency.ReentrantAttribute"/> attributed applied to its implementation class), the timer callback will be allowed | ||
/// to interleave with other grain calls and timers regardless of the value of this property. | ||
/// If this value is <see langword="true"/>, the timer callback will be allowed to interleave with other timers and grain calls. | ||
/// </remarks> | ||
public bool Reentrant { get; init; } | ||
} |
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
Oops, something went wrong.