-
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.
Fix TimerOrleansTest_Migration rounding error
- Loading branch information
1 parent
3246cec
commit fb033b5
Showing
11 changed files
with
239 additions
and
425 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,22 @@ | ||
using System; | ||
using System.Threading.Tasks; | ||
using System.Threading; | ||
|
||
namespace Orleans.Runtime | ||
{ | ||
/// <summary> | ||
/// Represents a grain timer and its functionality. | ||
/// </summary> | ||
internal interface IGrainTimer : IDisposable | ||
{ | ||
/// <summary> | ||
/// Starts the timer. | ||
/// </summary> | ||
void Start(); | ||
|
||
/// <summary> | ||
/// Stops the timer. | ||
/// </summary> | ||
void Stop(); | ||
namespace Orleans.Runtime; | ||
|
||
/// <summary> | ||
/// Gets the currently executing grain timer task. | ||
/// </summary> | ||
/// <returns>The currently executing grain timer task.</returns> | ||
Task GetCurrentlyExecutingTickTask(); | ||
} | ||
/// <summary> | ||
/// Represents a timer belonging to a grain. | ||
/// </summary> | ||
public interface IGrainTimer : IDisposable, IAsyncDisposable | ||
{ | ||
/// <summary>Changes the start time and the interval between method invocations for a timer, using <see cref="TimeSpan"/> values to measure time intervals.</summary> | ||
/// <param name="dueTime"> | ||
/// A <see cref="TimeSpan"/> representing the amount of time to delay before invoking the callback method specified when the <see cref="IGrainTimer"/> was constructed. | ||
/// Specify <see cref="Timeout.InfiniteTimeSpan"/> to prevent the timer from restarting. Specify <see cref="TimeSpan.Zero"/> to restart the timer immediately. | ||
/// </param> | ||
/// <param name="period"> | ||
/// The time interval between invocations of the callback method specified when the timer was constructed. | ||
/// Specify <see cref="Timeout.InfiniteTimeSpan"/> to disable periodic signaling. | ||
/// </param> | ||
/// <exception cref="ArgumentOutOfRangeException">The <paramref name="dueTime"/> or <paramref name="period"/> parameter, in milliseconds, is less than -1 or greater than 4294967294.</exception> | ||
void Change(TimeSpan dueTime, TimeSpan period); | ||
} |
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,32 @@ | ||
#nullable enable | ||
using System; | ||
using System.Threading.Tasks; | ||
using Orleans.Runtime; | ||
|
||
namespace Orleans.Timers | ||
namespace Orleans.Timers; | ||
|
||
/// <summary> | ||
/// Functionality for managing grain timers. | ||
/// </summary> | ||
public interface ITimerRegistry | ||
{ | ||
/// <summary> | ||
/// Functionality for managing grain timers. | ||
/// Creates a grain timer. | ||
/// </summary> | ||
public interface ITimerRegistry | ||
{ | ||
/// <summary> | ||
/// Creates a grain timer. | ||
/// </summary> | ||
/// <param name="grainContext">The grain which the timer is associated with.</param> | ||
/// <param name="asyncCallback">The timer callback, which will fire whenever the timer becomes due.</param> | ||
/// <param name="state">The state object passed to the callback.</param> | ||
/// <param name="dueTime"> | ||
/// The amount of time to delay before the <paramref name="asyncCallback"/> is invoked. | ||
/// Specify <see cref="System.Threading.Timeout.InfiniteTimeSpan"/> to prevent the timer from starting. | ||
/// Specify <see cref="TimeSpan.Zero"/> to invoke the callback promptly. | ||
/// </param> | ||
/// <param name="period"> | ||
/// The time interval between invocations of <paramref name="asyncCallback"/>. | ||
/// Specify <see cref="System.Threading.Timeout.InfiniteTimeSpan"/> to disable periodic signaling. | ||
/// </param> | ||
/// <returns> | ||
/// An <see cref="IDisposable"/> object which will cancel the timer upon disposal. | ||
/// </returns> | ||
IDisposable RegisterTimer(IGrainContext grainContext, Func<object, Task> asyncCallback, object state, TimeSpan dueTime, TimeSpan period); | ||
} | ||
/// <param name="grainContext">The grain which the timer is associated with.</param> | ||
/// <param name="callback">The timer callback, which will fire whenever the timer becomes due.</param> | ||
/// <param name="state">The state object passed to the callback.</param> | ||
/// <param name="dueTime"> | ||
/// The amount of time to delay before the <paramref name="callback"/> is invoked. | ||
/// Specify <see cref="System.Threading.Timeout.InfiniteTimeSpan"/> to prevent the timer from starting. | ||
/// Specify <see cref="TimeSpan.Zero"/> to invoke the callback promptly. | ||
/// </param> | ||
/// <param name="period"> | ||
/// The time interval between invocations of <paramref name="callback"/>. | ||
/// Specify <see cref="System.Threading.Timeout.InfiniteTimeSpan"/> to disable periodic signaling. | ||
/// </param> | ||
/// <returns> | ||
/// An <see cref="IGrainTimer"/> instance which represents the timer. | ||
/// </returns> | ||
IGrainTimer RegisterTimer(IGrainContext grainContext, Func<object?, Task> callback, object? state, TimeSpan dueTime, TimeSpan period); | ||
} |
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 was deleted.
Oops, something went wrong.
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.