CreateTaskFactory() public method

Creates the task factory.
public CreateTaskFactory ( ) : ITaskFactory
return ITaskFactory
コード例 #1
0
        /// <summary>
        /// Creates an async consumer queue that uses a task scheduler. The default task factory will be used.
        /// </summary>
        /// <param name="queueConnection">Queue and connection information.</param>
        /// <returns></returns>
        public IConsumerMethodQueueScheduler CreateConsumerMethodQueueScheduler(QueueConnection queueConnection)
        {
            Guard.NotNull(() => queueConnection, queueConnection);

            var schedulerCreator = new SchedulerContainer(_registerService);
            var factory          = schedulerCreator.CreateTaskFactory();

            factory.Scheduler.Start();
            Containers.Add(schedulerCreator);
            return(CreateConsumerMethodQueueSchedulerInternal(queueConnection, factory, null, true));
        }
コード例 #2
0
        /// <summary>
        /// Creates an async consumer queue that uses a task scheduler. The default task factory will be used.
        /// </summary>
        /// <param name="queue">The queue.</param>
        /// <param name="connection">The connection.</param>
        /// <returns></returns>
        public IConsumerQueueScheduler CreateConsumerQueueScheduler(string queue, string connection)
        {
            Guard.NotNullOrEmpty(() => queue, queue);
            Guard.NotNullOrEmpty(() => connection, connection);

            var schedulerCreator = new SchedulerContainer(_registerService);
            var factory          = schedulerCreator.CreateTaskFactory();

            factory.Scheduler.Start();
            Containers.Add(schedulerCreator);
            return(CreateConsumerQueueSchedulerInternal(queue, connection, factory, null, true));
        }