internal SessionsController(ITimeoutManager <Guid> sessions, ObjectCache sessionsCache, ISessionsRepository repo, IServiceLogRepository log) { _sessions = sessions; _sessionsCache = sessionsCache; _repo = repo; _log = log; }
/// <summary> /// Constructs the step, using the specified <see cref="ITimeoutManager"/> to defer relevant messages /// and the specified <see cref="ITransport"/> to deliver messages when they're due. /// </summary> public HandleDeferredMessagesStep(ITimeoutManager timeoutManager, ITransport transport, Options options, IRebusLoggerFactory rebusLoggerFactory, IAsyncTaskFactory asyncTaskFactory) { if (timeoutManager == null) { throw new ArgumentNullException(nameof(timeoutManager)); } if (transport == null) { throw new ArgumentNullException(nameof(transport)); } if (options == null) { throw new ArgumentNullException(nameof(options)); } if (rebusLoggerFactory == null) { throw new ArgumentNullException(nameof(rebusLoggerFactory)); } if (asyncTaskFactory == null) { throw new ArgumentNullException(nameof(asyncTaskFactory)); } _timeoutManager = timeoutManager; _transport = transport; _options = options; _log = rebusLoggerFactory.GetCurrentClassLogger(); var dueTimeoutsPollIntervalSeconds = (int)options.DueTimeoutsPollInterval.TotalSeconds; var intervalToUse = dueTimeoutsPollIntervalSeconds >= 1 ? dueTimeoutsPollIntervalSeconds : 1; _dueMessagesSenderBackgroundTask = asyncTaskFactory.Create(DueMessagesSenderTaskName, TimerElapsed, intervalSeconds: intervalToUse); }
/// <summary> /// Constructs the step, using the specified <see cref="ITimeoutManager"/> to defer relevant messages /// and the specified <see cref="ITransport"/> to deliver messages when they're due. /// </summary> public HandleDeferredMessagesStep(ITimeoutManager timeoutManager, ITransport transport, Options options, IRebusLoggerFactory rebusLoggerFactory, IAsyncTaskFactory asyncTaskFactory) { _timeoutManager = timeoutManager; _transport = transport; _options = options; _log = rebusLoggerFactory.GetCurrentClassLogger(); _dueMessagesSenderBackgroundTask = asyncTaskFactory.Create(DueMessagesSenderTaskName, TimerElapsed, intervalSeconds: 1); }
/// <summary> /// Constructs the step, using the specified <see cref="ITimeoutManager"/> to defer relevant messages /// and the specified <see cref="ITransport"/> to deliver messages when they're due. /// </summary> public HandleDeferredMessagesStep(ITimeoutManager timeoutManager, ITransport transport) { _timeoutManager = timeoutManager; _transport = transport; _dueMessagesSenderBackgroundTask = new AsyncTask("DueMessagesSender", TimerElapsed) { Interval = TimeSpan.FromSeconds(1) }; }
protected virtual ITimeoutManager <T> CreateTimeoutManager(int timeoutValue) { ITimeoutManager <T> timeoutManager = this.timeoutManagerFactory.CreateTimeoutManager <T>(timeoutValue); timeoutManager.ItemTimedOut += RaiseTimeoutEvents; Trace.TraceInformation("Adding timeout manager with a timeout value of '{0}'", timeoutValue); return(timeoutManager); }
/// <summary> /// Constructs the step, using the specified <see cref="ITimeoutManager"/> to defer relevant messages /// and the specified <see cref="ITransport"/> to deliver messages when they're due. /// </summary> public HandleDeferredMessagesStep(ITimeoutManager timeoutManager, ITransport transport, Options options, IRebusLoggerFactory rebusLoggerFactory) { _timeoutManager = timeoutManager; _transport = transport; _options = options; _log = rebusLoggerFactory.GetCurrentClassLogger(); _dueMessagesSenderBackgroundTask = new AsyncTask(DueMessagesSenderTaskName, TimerElapsed, rebusLoggerFactory) { Interval = TimeSpan.FromSeconds(1) }; }
/// <summary> /// Constructs the step, using the specified <see cref="ITimeoutManager"/> to defer relevant messages /// and the specified <see cref="ITransport"/> to deliver messages when they're due. /// </summary> public HandleDeferredMessagesStep(ITimeoutManager timeoutManager, ITransport transport, Options options, IRebusLoggerFactory rebusLoggerFactory, IAsyncTaskFactory asyncTaskFactory) { if (timeoutManager == null) throw new ArgumentNullException(nameof(timeoutManager)); if (transport == null) throw new ArgumentNullException(nameof(transport)); if (options == null) throw new ArgumentNullException(nameof(options)); if (rebusLoggerFactory == null) throw new ArgumentNullException(nameof(rebusLoggerFactory)); if (asyncTaskFactory == null) throw new ArgumentNullException(nameof(asyncTaskFactory)); _timeoutManager = timeoutManager; _transport = transport; _options = options; _log = rebusLoggerFactory.GetCurrentClassLogger(); var dueTimeoutsPollIntervalSeconds = (int)options.DueTimeoutsPollInterval.TotalSeconds; var intervalToUse = dueTimeoutsPollIntervalSeconds >= 1 ? dueTimeoutsPollIntervalSeconds : 1; _dueMessagesSenderBackgroundTask = asyncTaskFactory.Create(DueMessagesSenderTaskName, TimerElapsed, intervalSeconds: intervalToUse); }
/// <summary> /// Constructs the step, using the specified <see cref="ITimeoutManager"/> to defer relevant messages /// and the specified <see cref="ITransport"/> to deliver messages when they're due. /// </summary> public HandleDeferredMessagesStep(ITimeoutManager timeoutManager, ITransport transport, Options options, IRebusLoggerFactory rebusLoggerFactory, IAsyncTaskFactory asyncTaskFactory) { if (rebusLoggerFactory == null) { throw new ArgumentNullException(nameof(rebusLoggerFactory)); } if (asyncTaskFactory == null) { throw new ArgumentNullException(nameof(asyncTaskFactory)); } _timeoutManager = timeoutManager ?? throw new ArgumentNullException(nameof(timeoutManager)); _transport = transport ?? throw new ArgumentNullException(nameof(transport)); _options = options ?? throw new ArgumentNullException(nameof(options)); _log = rebusLoggerFactory.GetLogger <HandleDeferredMessagesStep>(); _dueMessagesSenderBackgroundTask = asyncTaskFactory.Create(DueMessagesSenderTaskName, TimerElapsed, interval: options.DueTimeoutsPollInterval); }
protected override void SetUp() { _factory = new TTimeoutManagerFactory(); _timeoutManager = _factory.Create(); }
internal RTLookupService(ResultHandler <ReconnectAttempt> reconnectAttemptListener, ITimeoutManager timeOutManager) { this.reconnectAttemptListener = reconnectAttemptListener; this.timeOutManager = timeOutManager; }
public bool CountTimeout(T timeoutItem, TimeSpan timeoutTimeSpan) { ITimeoutManager <T> timeoutManager = GetOrCreateTimeoutManager((int)timeoutTimeSpan.TotalMilliseconds); return(timeoutManager.CountTimeout(timeoutItem)); }