Akka.TestKit.TestScheduler.InternalSchedule C# (CSharp) Method

InternalSchedule() private method

private InternalSchedule ( System.TimeSpan initialDelay, System.TimeSpan delay, ICanTell receiver, object message, System.Action action, IActorRef sender, ICancelable cancelable, int deliveryCount ) : void
initialDelay System.TimeSpan
delay System.TimeSpan
receiver ICanTell
message object
action System.Action
sender IActorRef
cancelable ICancelable
deliveryCount int
return void
        private void InternalSchedule(TimeSpan? initialDelay, TimeSpan delay, ICanTell receiver, object message, Action action,
            IActorRef sender, ICancelable cancelable, int deliveryCount = 0)
        {
            var scheduledTime = _now.Add(initialDelay ?? delay).UtcTicks;

            Queue<ScheduledItem> tickItems = null;
            if (!_scheduledWork.TryGetValue(scheduledTime, out tickItems))
            {
                tickItems = new Queue<ScheduledItem>();
                _scheduledWork.TryAdd(scheduledTime, tickItems);
            }
            
            var type = message == null ? ScheduledItem.ScheduledItemType.Action : ScheduledItem.ScheduledItemType.Message;

            tickItems.Enqueue(new ScheduledItem(initialDelay ?? delay, delay, type, message, action,
                initialDelay.HasValue || deliveryCount > 0, receiver, sender, cancelable));
        }