June 2017
Intermediate to advanced
360 pages
10h 2m
English
Reliable Actor timers are modelled on timers available in the system.Timers namespace. The timers are usually used to carry out routine operations in the lifetime of an Actor, for example processing input data at a certain rate. You can declare and register a timer in your application using the following code, usually in the OnActivateAsync method:
private IActorTimer _updateTimer; protected override Task OnActivateAsync() { ... _updateTimer = RegisterTimer( CallBackMethod, // Callback method ObjectParameter, // Parameter to pass to the callback method TimeSpan.FromMilliseconds(15), // Amount of time to delay before the callback is invoked TimeSpan.FromMilliseconds(15)); // Time interval between invocations of the callback ...Read now
Unlock full access