示例#1
0
		public LuaObject Receive(IMessageQueue queue, int position)
		{
			var messageId = queue.ReadInt32(position);
			var message = this.registry.GetDefinition(messageId);
			Dictionary<LuaObject, LuaObject> table = new Dictionary<LuaObject, LuaObject>();
			foreach (var property in message.Properties)
			{
				var key = LuaObject.FromString(property.Name);
				switch (property.PropertyType)
				{
					case PropertyTypes.Int32:
						table[key] = LuaObject.FromNumber(queue.ReadInt32(position + property.Offset));
						break;
					case PropertyTypes.Single:
						table[key] = LuaObject.FromNumber(queue.ReadFloat(position + property.Offset));
						break;
					case PropertyTypes.String:
						table[key] =
							LuaObject.FromString(
								ExtensionMethods.ReadStringContent(queue, position + queue.ReadInt32(position + property.Offset)));
						break;
					default:
						throw new NotImplementedException();
				}
			}
			return LuaObject.FromTable(table);
		}
        public LifxGateway(IMessageQueue messageQueue) : base("Lifx")
        {
            _messageQueue = messageQueue;
            _canCreateDevices = false;
            _token = ConfigurationManager.AppSettings["lifx.token"];

            _localClient.DeviceDiscovered += async (s, e) =>
            {
                lock (_deviceLock)
                {
                    var device = _devices.Cast<LifxDevice>().SingleOrDefault(d => d.Id.Equals(e.Id));

                    if (device == null)
                    {
                        device = new LifxDevice(e);
                        _devices.Add(device);
                    }
                }

                await _localClient.GetLightStateAsync(e);
            };

            _localClient.VariableChanged += (s, e) =>
            {
                var device = _devices.Cast<LifxDevice>().SingleOrDefault(d => d.Id.Equals(e.Item1.Id));

                if (device != null)
                {
                    device.Name = e.Item1.Name;
                }

                var variable = $"{Name}.{e.Item1.Id}.{e.Item2}";
                _messageQueue.Publish(new UpdateVariableMessage(variable, e.Item3));
            };
        }
示例#3
0
 public PluginManagerFactory(ILogger logger, IConfiguration configuration, IMessageQueue messageQueue, IIsolatedEnvironmentFactory isolatedEnvironmentFactory)
 {
     _logger = logger;
     _configuration = configuration;
     _messageQueue = messageQueue;
     _isolatedEnvironmentFactory = isolatedEnvironmentFactory;
 }
		public int GetDynamicSize(IMessageQueue queue, LuaObject propertyValue)
		{
			if (propertyValue.IsNil)
			{
				return queue.GetStringLength(null);
			}
			return queue.GetStringLength(propertyValue.AsString());
		}
 public void CleanUp(IActorRef owner, IMessageQueue deadletters)
 {
     Envelope msg;
     while (TryDequeue(out msg)) // lock gets acquired inside the TryDequeue method
     {
         deadletters.Enqueue(owner, msg);
     }
 }
        public PushalotGateway(IMessageQueue messageQueue)
        {
            _messageQueue = messageQueue;

            Name = "Pushalot";
            CanCreateDevices = false;
            Devices = new List<IDevice>(0);
        }
        public SmsGateway(IMessageQueue messageQueue)
        {
            _messageQueue = messageQueue;

            Name = "SMS";
            CanCreateDevices = false;
            Devices = new List<IDevice>(0);
        }
 public void CleanUp(IActorRef owner, IMessageQueue deadletters)
 {
     Envelope msg;
     while (TryDequeue(out msg))
     {
         deadletters.Enqueue(owner, msg);
     }
 }
示例#9
0
 public NetworkPlayerPortal(IMessageQueue<IncomingGameMessageQueueItem> inQ, IMessageQueue<OutgoingGameMessageQueueItem> outQ, ISerialize iSerializer)
 {
     m_qIncomingQueue = inQ;
     m_qOutgoingQueue = outQ;
     m_bIsRunning = false;
     m_slrSerializer = iSerializer;
     m_tcGameFlow = new ThreadController(false);
     m_dicStorage = new Dictionary<string, object>();
 }
        public MyStromDeviceNameService(IMessageQueue messageQueue)
        {
            _messageQueue = messageQueue;
            _username = ConfigurationManager.AppSettings["mystrom.username"];
            _password = ConfigurationManager.AppSettings["mystrom.password"];

            _recentResultTimestamp = DateTime.MinValue;
            _recentResult = new Dictionary<string, string>(0);
        }
 public RadioStationController(
     ITuneInRadioStationService radioStationService,
     IFavoriteRadioStationService favoriteRadioStationService,
     IMessageQueue messageQueue)
 {
     _radioStationService = radioStationService;
     _favoriteRadioStationService = favoriteRadioStationService;
     _messageQueue = messageQueue;
 }
示例#12
0
		/// <summary>
		/// Copy message to other message queue.
		/// </summary>
		/// <param name="messageQueue">Soutce queue.</param>
		/// <param name="position">Position at source queue. Should be valid postion returned by   messageQueue.ReadMessage()</param>
		/// <param name="destinationQueue">Destination queue.</param>
		public static void CopyTo(this IMessageQueue messageQueue, int position, IMessageQueue destinationQueue)
		{
			var len = messageQueue.GetSize(position);
			var targetPosition = destinationQueue.Allocate(len);
			for (int i = 0; i < len; ++i)
			{
				destinationQueue.WriteInt32(targetPosition + i, messageQueue.ReadInt32(i + position));
			}
			destinationQueue.Commit(len);
		}
		public MessageQueueListener(IMessageQueue queue) : base("MessageQueueListener")
		{
			if(queue == null)
				throw new ArgumentNullException("queue");

			_queue = queue;

			if(!string.IsNullOrWhiteSpace(queue.Name))
				base.Name = queue.Name;
		}
        public ZwaveGateway(IMessageQueue messageQueue, IList<ICommandClassHandler> commandClassHandlers)
            : base("zwave")
        {
            _messageQueue = messageQueue;
            _commandClassHandlers = commandClassHandlers;
            _canCreateDevices = false;

            _comPortName = ConfigurationManager.AppSettings["zwave.port"];
            _library = new ZwaveDeviceLibrary();
            _nodeCommandQueues = new Dictionary<byte, ZwaveCommandQueue>();
        }
        public MyStromGateway(
            IMessageQueue messageQueue,
            IMyStromDeviceNameService myStromDeviceNameService,
            IUpnpDeviceDiscoveringService upnpDeviceDiscoveringService) : base("myStrom")
        {
            _messageQueue = messageQueue;
            _myStromDeviceNameService = myStromDeviceNameService;
            _upnpDeviceDiscoveringService = upnpDeviceDiscoveringService;
            _canCreateDevices = false;

            _upnpDeviceDiscoveringService.DeviceFound += OnUpnpDeviceFound;
        }
        public void Start(string id, IMessageQueue queue)
        {
            var suffix = Guid.NewGuid().ToString();

            PipelinePack pipelines = intelligenceManager.ComposePipeline(id, Name);

            var task1 = Task.Factory.StartNew(() => { RegisterStream(queue, pipelines.OfflinePipeline, id + "-offline-" + suffix, id); });
            var task2 = Task.Factory.StartNew(() => { RegisterStream(queue, pipelines.OnlinePipeline, id + "-online-" + suffix, id); });
            var task3 = Task.Factory.StartNew(() => { RegisterStream(queue, pipelines.DatabasePipeline, id + "-database-" + suffix, id); });

            Task.WaitAll(task1, task2, task3);
        }
示例#17
0
      public ImageService(
         IBinaryRepository binaryRepository,
         [Dependency("images")] IMessageQueue imageQueue,
         [Dependency("complete")] IMessageQueue completeQueue
      )
      {
         _binaryRepository = binaryRepository;
         _imageQueue = imageQueue;
         _completeQueue = completeQueue;

         InitializeComponent();
      }
示例#18
0
		public void Send(IMessageQueue queue, LuaObject luaObject)
		{
			var id = (int)luaObject[LuaObject.FromString("MessageId")].AsNumber();
			var message = this.registry.GetDefinition(id);

			var table = luaObject.AsTable();

			int dynamicSize = 0;
			int foundProperties = 0;
			foreach (var property in message.Properties)
			{
				var serializer = this.luaTypeRegistry.GetSerializer(property.PropertyType);
				LuaObject propertyValue;
				if (table.TryGetValue(LuaObject.FromString(property.Name), out propertyValue))
				{
					++foundProperties;
				}
				dynamicSize += serializer.GetDynamicSize(queue, propertyValue);
			}
			var position = queue.Allocate(message.MinSize + dynamicSize);

			foreach (var keyValue in table)
			{
				var keyObject = keyValue.Key;
				int propertyKey = 0;
				if (keyObject.IsNumber)
				{
					propertyKey = (int)keyObject.AsNumber();
				}
				else
				{
					propertyKey = Hash.Eval(keyObject.AsString());
				}

				var property = message.GetPropertyById(propertyKey);
				switch (property.PropertyType)
				{
					case PropertyTypes.Int32:
						queue.WriteInt32(position + property.Offset, (int)keyValue.Value.AsNumber());
						break;
					case PropertyTypes.Single:
						queue.WriteFloat(position + property.Offset, (float)keyValue.Value.AsNumber());
						break;
					case PropertyTypes.String:
						queue.WriteInt32(position + property.Offset, message.MinSize);
						queue.WriteStringContent(position + message.MinSize, keyValue.Value.AsString());
						break;
					default:
						throw new NotImplementedException();
				}
			}
			queue.Commit(position);
		}
示例#19
0
        public void Start(string id, IMessageQueue queue)
        {
            var suffix = Guid.NewGuid().ToString();

            var pipeline = new StreamPipeline();

            pipeline.Register(new MeanPredictionFilter());
            pipeline.Register(new ResultOutputFilter(repository) { MeasurementId = id, ForecastModelId = name });

            var task1 = Task.Factory.StartNew(() => { RegisterStream(queue, pipeline, id + "-online-" + suffix, id); });

            Task.WaitAll(task1);
        }
        public PhilipsHueBridgeDiscoveringService(
            IMessageQueue messageQueue,
            IVariableRepository variableRepository,
            IUpnpDeviceDiscoveringService upnpDeviceDiscoveringService)
        {
            _lock = new object();
            _bridges = new Dictionary<string, PhilipsHueBridge>(StringComparer.OrdinalIgnoreCase);
            _messageQueue = messageQueue;
            _variableRepository = variableRepository;
            _upnpDeviceDiscoveringService = upnpDeviceDiscoveringService;

            _upnpDeviceDiscoveringService.DeviceFound += OnUpnpDeviceFound;
        }
示例#21
0
 public UploadController(
    IImageRepository imageRepository,
    IBinaryRepository binaryRepository,
    [Dependency("Image")] IMessageQueue messageQueue,
    FileUploaderAdapter adapter
 )
 {
    ActionInvoker = new ActionInvokers.ActionInvoker();
    _imageRepository = imageRepository;
    _binaryRepository = binaryRepository;
    _messageQueue = messageQueue;
    _adapter = adapter;
 }
示例#22
0
		public SurveyAnswerStore(
			ITenantStore tenantStore,
			ISurveyAnswerContainerFactory surveyAnswerContainerFactory,
			IMessageQueue<SurveyAnswerStoredMessage> standardSurveyAnswerStoredQueue,
			IMessageQueue<SurveyAnswerStoredMessage> premiumSurveyAnswerStoredQueue,
			IBlobContainer<List<string>> surveyAnswerIdsListContainer)
		{
			Trace.WriteLine(string.Format("Called constructor in SurveyAnswerStore"), "UNITY");
			this.tenantStore = tenantStore;
			this.surveyAnswerContainerFactory = surveyAnswerContainerFactory;
			this.standardSurveyAnswerStoredQueue = standardSurveyAnswerStoredQueue;
			this.premiumSurveyAnswerStoredQueue = premiumSurveyAnswerStoredQueue;
			this.surveyAnswerIdsListContainer = surveyAnswerIdsListContainer;
		}
        public ForecastGateway(IMessageQueue messageQueue) : base("Weather")
        {
            _messageQueue = messageQueue;
            _apiKey = ConfigurationManager.AppSettings["forecast.apikey"];
            _canCreateDevices = true;

            _policy = Policy
                .Handle<WebException>()
                .WaitAndRetry(new[]
                {
                    TimeSpan.FromSeconds(1),
                    TimeSpan.FromSeconds(2),
                    TimeSpan.FromSeconds(5)
                });
        }
        public SystemInformationMessageQueueFeeder(ISystemInformationProvider systemInformationProvider, IMessageQueue<SystemInformation> workQueue)
        {
            if (systemInformationProvider == null)
            {
                throw new ArgumentNullException("systemInformationProvider");
            }

            if (workQueue == null)
            {
                throw new ArgumentNullException("workQueue");
            }

            this.systemInformationProvider = systemInformationProvider;
            this.workQueue = workQueue;
        }
        public NetatmoGateway(IMessageQueue messageQueue) : base("Netatmo")
        {
            _messageQueue = messageQueue;
            _clientId = ConfigurationManager.AppSettings["netatmo.clientid"];
            _clientSecret = ConfigurationManager.AppSettings["netatmo.clientsecret"];
            _username = ConfigurationManager.AppSettings["netatmo.username"];
            _password = ConfigurationManager.AppSettings["netatmo.password"];

            _isValidConfiguration =
                !string.IsNullOrEmpty(_clientId) &&
                !string.IsNullOrEmpty(_clientSecret) &&
                !string.IsNullOrEmpty(_username) &&
                !string.IsNullOrEmpty(_password);

            _canCreateDevices = false;
        }
示例#26
0
      protected void Application_Start()
      {
         InitializeContainer();
         ControllerBuilder.Current.SetControllerFactory(typeof(ControllerFactory));
         RegisterRoutes(RouteTable.Routes);

         _completeQueue = _container.Resolve<IMessageQueue>("Complete");

         _pollingThread = new Thread(CompletePolling);

         var repositories = new Repositories
         {
            BinaryRepository = _container.Resolve<IBinaryRepository>(),
            ImageRepository = _container.Resolve<IImageRepository>()
         };

         _pollingThread.Start(repositories);
      }
示例#27
0
        private static void RunTest(string desc, IMessageQueue queue)
        {
            _received = 0;
            _evt.Reset();
            using (queue)
            {
                queue.StartConsuming();

                var sw = Stopwatch.StartNew();
                for (int i = 0; i < TIMES; i++)
                {
                    queue.Publish(i.ToString());
                }

                _evt.WaitOne();
                Console.WriteLine(desc + ": " + sw.Elapsed);
            }
        }
示例#28
0
 private void RegisterStream(IMessageQueue messageQueue, StreamPipeline pipeline, string pipelineName, string id)
 {
     while (true)
     {
         try
         {
             var units = messageQueue.Dequeue(id, pipelineName);
             pipeline.Execute(units);
         }
         catch (EndOfStreamException)
         {
             Console.WriteLine("End of stream");
             break;
         }
         catch (Exception ex)
         {
             Logging.Debug(ex.ToString());
             throw;
         }
     }
 }
        public SystemInformationMessageQueueWorker(ISystemInformationSender systemInformationSender, IMessageQueue<SystemInformation> workQueue, IMessageQueue<SystemInformation> errorQueue)
        {
            if (systemInformationSender == null)
            {
                throw new ArgumentNullException("systemInformationSender");
            }

            if (workQueue == null)
            {
                throw new ArgumentNullException("workQueue");
            }

            if (errorQueue == null)
            {
                throw new ArgumentNullException("errorQueue");
            }

            this.systemInformationSender = systemInformationSender;
            this.workQueue = workQueue;
            this.errorQueue = errorQueue;
        }
示例#30
0
        public PluginManager(ILogger logger, IConfiguration configuration, IMessageQueue messageQueue, IDirectory baseDirectory, IIsolatedEnvironment environment, IPackage package)
        {
            ErrorCount = 0;

            if (logger == null) throw new ArgumentNullException("logger");
            if (configuration == null) throw new ArgumentNullException("configuration");
            if (baseDirectory == null) throw new ArgumentNullException("baseDirectory");
            if (environment == null) throw new ArgumentNullException("environment");
            if (package == null) throw new ArgumentNullException("package");

            State = PluginState.Unloaded;

            _logger = logger;
            _configuration = configuration;
            _messageQueue = messageQueue;
            _baseDirectory = baseDirectory;
            _isolatedEnvironment = environment;
            _package = package;
            _lazyManifest = new Lazy<IManifest>(_package.GetManifest);

            _isolatedEnvironment.UnhandledError += OnUnhandledError;
        }
示例#31
0
 public static async Task PublishAsBytesAsync(this IMessageQueue messageQueue, string queue, object message)
 {
     var bytes = message.ToBytes();
     await messageQueue.PublishAsync(queue, bytes);
 }
示例#32
0
 public CnblogsSpider(IDynamicMessageQueue dmq, IMessageQueue mq, IStatisticsService statisticsService, ISpiderOptions options,
                      ILogger <Spider> logger, IServiceProvider services) : base(dmq, mq, statisticsService, options, logger, services)
 {
 }
示例#33
0
 public DequeuedCleanupJob(IMessageQueue <TWorkItem> workItemQueue, ILogger <DequeuedCleanupJob <TWorkItem> > logger, IConfiguration configuration)
 {
     _workItemQueue = workItemQueue ?? throw new ArgumentNullException(nameof(workItemQueue));
     _logger        = logger ?? throw new ArgumentNullException(nameof(logger));
     _configuration = configuration ?? throw new ArgumentNullException(nameof(configuration));
 }
示例#34
0
 public ImparterChannel(IMessageQueue messageQueue)
 {
     _messageQueue = messageQueue;
 }
示例#35
0
 public MessageEntrance(IMessageQueue messageQueueIn)
 {
     this.messageQueueIn = messageQueueIn;
     SiteToSiteMessages  = new Queue <PlatformMessage>();
 }
示例#36
0
 public WebHookController(IWebHookService webHookService, IMessageQueue messageQueue)
 {
     _webHookService = webHookService;
     _messageQueue   = messageQueue;
 }
示例#37
0
 /// <summary>
 ///     Creates a new instance of <see cref="SaveReportHandler" />.
 /// </summary>
 /// <param name="queue">Queue to store inbound reports in</param>
 /// <exception cref="ArgumentNullException">queueProvider;connectionFactory</exception>
 public SaveReportHandler(IMessageQueue queue, IAdoNetUnitOfWork unitOfWork, IReportConfig reportConfig)
 {
     _unitOfWork = unitOfWork;
     _queue      = queue ?? throw new ArgumentNullException(nameof(queue));
     _maxSizeForJsonErrorReport = reportConfig.MaxReportJsonSize;
 }
示例#38
0
 public HjTcpNetwork(int maxBytesOnceSent = 1024 * 100, int maxReceiveBuffer = 1024 * 512) : base(maxBytesOnceSent, maxReceiveBuffer)
 {
     mSendSemaphore = new HjSemaphore();
     mSendMsgQueue  = new MessageQueue();
 }
示例#39
0
 public GithubSpider(IMessageQueue mq, IStatisticsService statisticsService, ISpiderOptions options,
                     ILogger <Spider> logger, IServiceProvider services) : base(mq, statisticsService, options, logger, services)
 {
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="UpdateDailyMiningHyconHandler"/> class.
 /// </summary>
 /// <param name="repository">Aggregate repository</param>
 /// <param name="addressHandler">Address info handler</param>
 /// <param name="messageQueue">Messaging service</param>
 /// <param name="handler">JSON handler</param>
 /// <param name="mineHandler">Modify balance handler</param>
 /// <param name="blockListV2Handler">JSON block list handler</param>
 /// <param name="blockInfoV2Handler">JSON block info handler</param>
 /// <param name="log">Log service</param>
 public UpdateDailyMiningHyconHandler(IEsRepository <IAggregate> repository, ICommandHandler <RequestJson <AddressInfo> > addressHandler, IMessageQueue messageQueue, ICommandHandler <RequestJson <MinedResults> > handler, ICommandHandler <RetroactiveCommand <MineCoin> > mineHandler, ICommandHandler <RequestJson <BlockListV2> > blockListV2Handler, ICommandHandler <RequestJson <BlockInfoV2> > blockInfoV2Handler, ILog log)
     : base(repository, mineHandler)
 {
     _addressHandler     = addressHandler;
     _messageQueue       = messageQueue;
     _handler            = handler;
     _blockListV2Handler = blockListV2Handler;
     _blockInfoV2Handler = blockInfoV2Handler;
     _log = log;
 }
示例#41
0
 /// <summary>
 /// Creates a new mailbox
 /// </summary>
 /// <param name="messageQueue">The <see cref="IMessageQueue"/> used by this mailbox.</param>
 public Mailbox(IMessageQueue messageQueue)
 {
     MessageQueue = messageQueue;
 }
示例#42
0
 public SlackController(IMessageQueue messageQueue)
 {
     _messageQueue          = messageQueue;
     _slackRequestValidator = new SlackRequestValidator();
 }
示例#43
0
 /// <summary>
 /// 构造方法
 /// </summary>
 /// <param name="mq">消息队列</param>
 /// <param name="downloaderAgentStore">下载器代理存储</param>
 /// <param name="options">系统选项</param>
 /// <param name="logger">日志接口</param>
 public DownloadCenter(IDynamicMessageQueue dmq, IMessageQueue mq, IDownloaderAgentStore downloaderAgentStore, ISpiderOptions options,
                       ILogger logger) : base(dmq, mq, downloaderAgentStore, options, logger)
 {
 }
示例#44
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MsmqChannelController"/> class.
 /// </summary>
 /// <param name="queue">The queue.</param>
 internal MsmqChannelController(IMessageQueue queue)
 {
     _queue = queue;
 }
示例#45
0
 public AudioEncoder()
 {
     log   = ServiceScope.Get <ILogger>();
     queue = ServiceScope.Get <IMessageBroker>().GetOrCreate("encoding");
     msg   = new QueueMessage();
 }
示例#46
0
 internal MessageQueue(IMessageQueue delegateQueue)
 {
     this.delegateQueue           = delegateQueue;
     formatter                    = new XmlMessageFormatter();
     delegateQueue.PeekCompleted += new CompletedEventHandler(DelegatePeekCompleted);
 }
示例#47
0
 public MQTTDecoderSnowdepth(IMessageQueue messageQueue, IContextBrokerProxy contextBroker)
 {
     _fiwareContextBroker = contextBroker;
     _messageQueue        = messageQueue;
 }
 public void ProcessNext(TState state, IMessageQueue queue) => Process(_queue.Dequeue(), state);
示例#49
0
 public StuffDragManager(string request, IImmutableList <StuffId> stuff, IMessageQueue queue) : base(request)
 {
     Stuff  = stuff;
     _queue = queue;
 }
 public MessageQueueFixture(IMessageQueue queue)
 {
     _queue = queue;
 }
示例#51
0
 public ActionDragManager(string request, IImmutableList <ImmutableAction> action, IMessageQueue queue) : base(request)
 {
     _actions = action;
     _queue   = queue;
 }
示例#52
0
 /// <summary>
 /// TBD
 /// </summary>
 /// <param name="owner">TBD</param>
 /// <param name="deadletters">TBD</param>
 public void CleanUp(IActorRef owner, IMessageQueue deadletters)
 {
     // do nothing
 }
示例#53
0
 public void Setup()
 {
     _queue = new Mock <IMessageQueue>().Object;
 }
示例#54
0
 /// <summary>
 /// Initializes a new instance of the <see cref="GlobalProjection{TState}"/> class.
 /// </summary>
 /// <param name="eventStore">Event store service</param>
 /// <param name="log">Log service</param>
 /// <param name="activeTimeline">Timeline service</param>
 /// <param name="messageQueue">Message queue service</param>
 /// <param name="streamLocator">Stream locator</param>
 public GlobalProjection(IEventStore <IAggregate> eventStore, ILog log, ITimeline activeTimeline, IMessageQueue messageQueue, IStreamLocator streamLocator)
     : base(eventStore, log, activeTimeline, streamLocator)
 {
     InvalidateSubscription = new LazySubscription(() =>
                                                   messageQueue.Alerts.OfType <InvalidateProjections>()
                                                   .Throttle(Configuration.Throttle)
                                                   .Subscribe(Build.InputBlock.AsObserver()));
 }
示例#55
0
 public AutoInputHint_BotToUser(IBotToUser inner, IMessageQueue queue)
 {
     SetField.NotNull(out this.queue, nameof(queue), queue);
     SetField.NotNull(out this.inner, nameof(inner), inner);
 }
示例#56
0
文件: Remote.cs 项目: zedr0n/ZES
 /// <summary>
 /// Initializes a new instance of the <see cref="Remote"/> class.
 /// </summary>
 /// <param name="localStore">Local stream store</param>
 /// <param name="remoteStore">Target remote</param>
 /// <param name="log">Log helper</param>
 /// <param name="messageQueue">Message queue</param>
 /// <param name="serializer">Serializer</param>
 public Remote(IStreamStore localStore, [Remote] IStreamStore remoteStore, ILog log, IMessageQueue messageQueue, ISerializer <IEvent> serializer)
 {
     _localStore   = localStore;
     _remoteStore  = remoteStore;
     _log          = log;
     _messageQueue = messageQueue;
     _serializer   = serializer;
 }
示例#57
0
 public MessageQueueFixture(IMessageQueue queue, bool isFifo)
 {
     _queue  = queue;
     _isFifo = isFifo;
 }
示例#58
0
 public SlackBot(string apiKey)
 {
     _msgQueue = new MessageQueue();
     _apiKey   = apiKey;
 }
示例#59
0
 public Mailer(IMessageQueue messageQueue)
 {
     _messageQueue = messageQueue ?? throw new ArgumentNullException(nameof(messageQueue));
 }
示例#60
0
 /// <summary>
 /// 依赖于消息队列的事件模块
 /// </summary>
 /// <param name="queueName">队列名称</param>
 /// <param name="messageQueue">消息队列实现类</param>
 public MessageEvent(string queueName, IMessageQueue messageQueue)
 {
     QueueName    = queueName;
     MessageQueue = messageQueue;
 }