Exemplo n.º 1
0
        public override Task OnActivateAsync()
        {
            RegisterTimer(TickMaintenanceAsyncDelegate, this, _options.MaintenancePeriod, _options.MaintenancePeriod);

            // remove expired state
            var recoveryTask =
                _state.State.Value != null && IsExpired()
                ? ResetAsync()
                : Task.CompletedTask;

            // enroll as a weak activation
            _activity.State.Priority = ActivityPriority.Normal;
            var enlistTask = _activity.EnlistAsync();

            return(Task.WhenAll(recoveryTask, enlistTask));
        }
Exemplo n.º 2
0
 public Task EnlistAsync()
 {
     _state.State.FakeProperty = 1;
     return(_state.EnlistAsync());
 }