public override Task Initialize(IStreamQueueMapper queueMapper)
 {
     if (queueMapper == null)
     {
         throw new ArgumentNullException("queueMapper");
     }
     if (!(queueMapper is IConsistentRingStreamQueueMapper))
     {
         throw new ArgumentException("queueMapper for ConsistentRingQueueBalancer should implement IConsistentRingStreamQueueMapper", "queueMapper");
     }
     streamQueueMapper = (IConsistentRingStreamQueueMapper)queueMapper;
     return(base.Initialize(queueMapper));
 }
Пример #2
0
 public override Task Initialize(string strProviderName,
                                 IStreamQueueMapper queueMapper)
 {
     if (queueMapper == null)
     {
         throw new ArgumentNullException("queueMapper");
     }
     if (!(queueMapper is IConsistentRingStreamQueueMapper))
     {
         throw new ArgumentException("queueMapper for ConsistentRingQueueBalancer should implement IConsistentRingStreamQueueMapper", "queueMapper");
     }
     streamQueueMapper = (IConsistentRingStreamQueueMapper)queueMapper;
     return(Task.CompletedTask);
 }
Пример #3
0
        public SQSAdapter(IConsistentRingStreamQueueMapper streamQueueMapper, string dataConnectionString, string deploymentId, string providerName)
        {
            if (string.IsNullOrEmpty(dataConnectionString))
            {
                throw new ArgumentNullException("dataConnectionString");
            }
            if (string.IsNullOrEmpty(deploymentId))
            {
                throw new ArgumentNullException("deploymentId");
            }

            DataConnectionString = dataConnectionString;
            DeploymentId         = deploymentId;
            Name = providerName;
            this.streamQueueMapper = streamQueueMapper;
        }
Пример #4
0
 public SQSAdapter(SerializationManager serializationManager, IConsistentRingStreamQueueMapper streamQueueMapper, ILoggerFactory loggerFactory, string dataConnectionString, string serviceId, string providerName)
 {
     if (string.IsNullOrEmpty(dataConnectionString))
     {
         throw new ArgumentNullException("dataConnectionString");
     }
     if (string.IsNullOrEmpty(serviceId))
     {
         throw new ArgumentNullException(nameof(serviceId));
     }
     this.loggerFactory        = loggerFactory;
     this.serializationManager = serializationManager;
     DataConnectionString      = dataConnectionString;
     this.ServiceId            = serviceId;
     Name = providerName;
     this.streamQueueMapper = streamQueueMapper;
 }
        public ConsistentRingQueueBalancer(
            IConsistentRingProviderForGrains ringProvider,
            IStreamQueueMapper queueMapper)
        {
            if (ringProvider == null)
            {
                throw new ArgumentNullException("ringProvider");
            }
            if (queueMapper == null)
            {
                throw new ArgumentNullException("queueMapper");
            }
            if (!(queueMapper is IConsistentRingStreamQueueMapper))
            {
                throw new ArgumentException("queueMapper for ConsistentRingQueueBalancer should implement IConsistentRingStreamQueueMapper", "queueMapper");
            }

            streamQueueMapper = (IConsistentRingStreamQueueMapper)queueMapper;
            myRange = ringProvider.GetMyRange();

            ringProvider.SubscribeToRangeChangeEvents(this);
        }
        public ConsistentRingQueueBalancer(
            IConsistentRingProviderForGrains ringProvider,
            IStreamQueueMapper queueMapper)
        {
            if (ringProvider == null)
            {
                throw new ArgumentNullException("ringProvider");
            }
            if (queueMapper == null)
            {
                throw new ArgumentNullException("queueMapper");
            }
            if (!(queueMapper is IConsistentRingStreamQueueMapper))
            {
                throw new ArgumentException("queueMapper for ConsistentRingQueueBalancer should implement IConsistentRingStreamQueueMapper", "queueMapper");
            }

            streamQueueMapper = (IConsistentRingStreamQueueMapper)queueMapper;
            myRange           = ringProvider.GetMyRange();

            ringProvider.SubscribeToRangeChangeEvents(this);
        }