Esempio n. 1
0
        public Lazy <BaseTasksCoordinator> GetTaskCoordinator(BaseSSSBService <TDispatcher, TMessageReaderFactory> service)
        {
            if (this._tasksCoordinator == null)
            {
                this._tasksCoordinator = new Lazy <BaseTasksCoordinator>(() =>
                {
                    return(new SSSBTasksCoordinator(LoggerFactory, GetMessageReaderFactory(service).Value, service.MaxReadersCount, service.IsQueueActivationEnabled, service.MaxReadParallelism));
                }, true);
            }

            return(this._tasksCoordinator);
        }
Esempio n. 2
0
        public Lazy <ISSSBMessageDispatcher> GetMessageDispatcher(BaseSSSBService <TDispatcher, TMessageReaderFactory> service)
        {
            if (this._messageDispatcher == null)
            {
                this._messageDispatcher = new Lazy <ISSSBMessageDispatcher>(() =>
                {
                    return(ActivatorUtilities.CreateInstance <TDispatcher>(services, new object[] { service }));
                }, true);
            }

            return(this._messageDispatcher);
        }