public ChatRoom( ICallbackQueue callbackQueue, IDateTimeSvc dateTimeSvc, IMessageRepo messageRepo) { this.callbackQueue = callbackQueue; this.dateTimeSvc = dateTimeSvc; this.messageRepo = messageRepo; }
public ChatController( IAuthSvc authSvc, IChatRoom chatRoom, IDateTimeSvc dateTimeSvc) { this.authSvc = authSvc; this.chatRoom = chatRoom; this.dateTimeSvc = dateTimeSvc; }
public static void StartTimers(ICallbackQueue callbackQueue, ITimerSvc timerSvc, IDateTimeSvc dateTimeSvc) { var period = Math.Floor(Const.IdleCallbackLimit / 2) * 1000; timerSvc.AddPeriodicTimer(Const.CallIdleCallbacksTimerId, period, () => { var expiry = dateTimeSvc.GetCurrentDateTimeAsUtc().AddSeconds(Const.IdleCallbackLimit * -1); var newSince = dateTimeSvc.GetCurrentDateTimeAsUtc().AddSeconds(-1); foreach (var callback in callbackQueue.DequeueExpired(expiry)) callback(new string[] { }, newSince); }); }