Пример #1
0
        /// <summary>
        /// Initializes a new instance of Producer using the given connectionSettings to connect to the Queue.
        /// </summary>
        /// <param name="connectionSettings">
        /// The ConnectionSettings which define the Storage Account and Queue to use.
        /// </param>
        /// <param name="factory">
        /// The JobFactory to use to serialize instances of IJob.
        /// </param>
        public Producer(ConnectionSettings connectionSettings, JobFactory factory)
        {
            if (null == connectionSettings)
            {
                throw new ArgumentNullException("connectionSettings");
            }
            else if (null == factory)
            {
                throw new ArgumentNullException("factory");
            }

            queue = connectionSettings.GetQueue();
            queue.CreateIfNotExists();

            this.connectionSettings = connectionSettings;
            this.factory = factory;
        }
Пример #2
0
        /// <summary>
        /// Initializes a new instance of Consumer using the given connectionSettings to connect to the Queue.
        /// </summary>
        /// <param name="connectionSettings">
        /// The ConnectionSettings which define the Storage Account and Queue to use.
        /// </param>
        /// <param name="factory">
        /// The JobFactory to use to create instances of IJob.
        /// </param>
        /// <param name="settings">
        /// The ConsumerSettings to use. If null, the default ConsumerSettings will be used.
        /// </param>
        public Consumer(ConnectionSettings connectionSettings, JobFactory factory, ConsumerSettings settings)
        {
            if (null == connectionSettings)
            {
                throw new ArgumentNullException("connectionSettings");
            }
            else if (null == factory)
            {
                throw new ArgumentNullException("factory");
            }

            queue = connectionSettings.GetQueue();
            queue.CreateIfNotExists();

            this.connectionSettings = connectionSettings;
            this.factory = factory;
            this.consumerSettings = settings ?? ConsumerSettings.CreateDefault();
        }
Пример #3
0
 /// <summary>
 /// Initializes a new instance of Consumer using the given connectionSettings to connect to the Queue, and
 /// using the default ConsumerSettings.
 /// </summary>
 /// <param name="connectionSettings">
 /// The ConnectionSettings which define the Azure Storage Account and Queue to use.
 /// </param>
 /// <param name="factory">
 /// The JobFactory to use to create instances of IJob.
 /// </param>
 public Consumer(ConnectionSettings connectionSettings, JobFactory factory)
     : this(connectionSettings, factory, ConsumerSettings.CreateDefault())
 {
 }