Esempio n. 1
0
        private GrainTimer(OrleansTaskScheduler scheduler, IActivationData activationData, ILogger logger, Func <object, Task> asyncCallback, object state, TimeSpan dueTime, TimeSpan period, string name)
        {
            var ctxt = RuntimeContext.CurrentGrainContext;

            scheduler.CheckSchedulingContextValidity(ctxt);
            this.scheduler      = scheduler;
            this.activationData = activationData;
            this.logger         = logger;
            this.Name           = name;
            this.asyncCallback  = asyncCallback;
            timer = new AsyncTaskSafeTimer(logger,
                                           stateObj => TimerTick(stateObj, ctxt),
                                           state);
            this.dueTime     = dueTime;
            timerFrequency   = period;
            previousTickTime = DateTime.UtcNow;
            totalNumTicks    = 0;
        }