public FileDecompressor(IQueueReader queueReader, IQueueWriter queueWriter)
        {
            _queueReader = queueReader;
            _queueWriter = queueWriter;

            _fileProcessData = FileProcessData.Instance;
        }
Esempio n. 2
0
 public StreamingTimerService(IQueueWriter target, IStreamingContainer storage, IEnvelopeStreamer streamer)
 {
     _target   = target;
     _storage  = storage;
     _streamer = streamer;
     _suffix   = Guid.NewGuid().ToString().Substring(0, 4);
 }
 public GZipProcessor(IQueueReader queueReader, IQueueWriter queueWriter, IGZipProgress gZipProgress, IValidator validator)
 {
     _queueReader  = queueReader;
     _queueWriter  = queueWriter;
     _gZipProgress = gZipProgress;
     _validator    = validator;
 }
 public StreamingTimerService(IQueueWriter target, IStreamingContainer storage, IEnvelopeStreamer streamer)
 {
     _target = target;
     _storage = storage;
     _streamer = streamer;
     _suffix = Guid.NewGuid().ToString().Substring(0, 4);
 }
Esempio n. 5
0
        static void Main(string[] args)
        {
            var services = new ServiceCollection();

            ConfigureServices(services);
            IQueueReader reader = null;
            IQueueWriter writer = null;

            using (ServiceProvider serviceProvider = services.BuildServiceProvider())
            {
                writer = serviceProvider.GetService <IQueueWriter>();
                reader = serviceProvider.GetService <IQueueReader>();
            }
            var putMsg = new QueueMessage()
            {
                CorrelationId = Guid.NewGuid().ToString(),
                Data          = "This is a message",
                QueueName     = "DEV.QUEUE.1"
            };

            writer.Enqueue(putMsg);

            var getMsg = reader.Dequque();

            Console.WriteLine(getMsg.Data);
        }
        // ReSharper disable InconsistentNaming
        static void TestConfiguration(IQueueWriter sender, CqrsEngineBuilder builder)
        {
            int i = 0;

            using (var t = new CancellationTokenSource())
                using (TestObserver.When <MessageAcked>(ea =>
                {
                    if (ea.Context.QueueName != "do")
                    {
                        return;
                    }
                    if (i++ >= 5)
                    {
                        t.Cancel();
                    }
                }))
                    using (var engine = builder.Build())
                    {
                        engine.Start(t.Token);
                        sender.PutMessage(new byte[1]);
                        if (!t.Token.WaitHandle.WaitOne(5000))
                        {
                            t.Cancel();
                        }
                        Assert.IsTrue(t.IsCancellationRequested);
                    }
        }
Esempio n. 7
0
        public static GZipStrategy CompressorFactory(IQueueReader queueReader, IQueueWriter queueWriter, IGZipProgress gZipProgress)
        {
            var fileCompressor = new FileCompressor(queueReader, queueWriter);
            var fileReader     = new FileReaderForCompress(queueReader, gZipProgress);
            var fileWriter     = new FileWriterForCompress(queueWriter, gZipProgress);

            return(new GZipStrategy(fileCompressor, fileReader, fileWriter));
        }
Esempio n. 8
0
 public AggregateFactory(ITapeStorageFactory factory, IEnvelopeStreamer streamer, IQueueWriter writer, NuclearStorage storage, IIdentityGenerator generator)
 {
     _factory   = factory;
     _streamer  = streamer;
     _writer    = writer;
     _storage   = storage;
     _generator = generator;
 }
Esempio n. 9
0
        internal MessageSender(IQueueWriter writer, QueueMessageSerializer serializer)
        {
            if (writer == null) throw new ArgumentNullException("writer");
            if (serializer == null) throw new ArgumentNullException("serializer");

            _writer = writer;
            _serializer = serializer;
        }
Esempio n. 10
0
        public MessageSender(IQueueWriter[] queues, Func<string> idGenerator)
        {
            m_queues = queues;
            m_idGenerator = idGenerator;

            if (queues.Length == 0)
                throw new InvalidOperationException("There should be at least one queue");
        }
Esempio n. 11
0
 public SampleSaga(ILog <SampleSaga> log,
                   IExampleDataAccess dataAccess,
                   IQueueWriter queueWriter)
 {
     _log         = log;
     _dataAccess  = dataAccess;
     _queueWriter = queueWriter;
 }
        public DefaultMessageSender(IQueueWriter[] queues, ISystemObserver observer, Func<string> idGenerator)
        {
            _queues = queues;
            _observer = observer;
            _idGenerator = idGenerator;

            if (queues.Length == 0)
                throw new InvalidOperationException("There should be at least one queue");
        }
Esempio n. 13
0
 public SampleDistributedTaskHandler(
     ILog <SampleDistributedTaskHandler> log,
     IExampleDataAccess dataAccess,
     IQueueWriter queueWriter)
 {
     _log         = log;
     _dataAccess  = dataAccess;
     _queueWriter = queueWriter;
 }
        public SimpleMessageSender(IEnvelopeStreamer streamer, IQueueWriter[] queues, Func<string> idGenerator = null)
        {
            _queues = queues;
            _idGenerator = idGenerator ?? (() =>Guid.NewGuid().ToString());
            _streamer = streamer;

            if (queues.Length == 0)
                throw new InvalidOperationException("There should be at least one queue");
        }
Esempio n. 15
0
        public ServiceManager(IQueueWriter queueWriter, KseConfiguration configuration, ILogger <ServiceManager> logger)
        {
            this.queueWriter   = queueWriter;
            this.configuration = configuration;
            if (this.configuration == null)
            {
                this.configuration = new KseConfiguration();
            }
            this.logger = logger;

            incomingCallMetrics = new ConcurrentBag <IncomingCallMetric>();
            outgoingCallMetrics = new ConcurrentBag <OutgoingCallMetric>();
        }
 public EventStoreToQueueDistributor(
     string queueName,
     IQueueFactory queueFactory,
     IEventStore eventStore,
     IDocumentStore projectionStore,
     ISerializer serializer)
 {
     _markerReader = projectionStore.GetReader<string, EventStoreMarker>();
     _markerWriter = projectionStore.GetWriter<string, EventStoreMarker>();
     _queueName = queueName;
     _eventStore = eventStore;
     _queueWriter = queueFactory.CreateWriter(queueName);
     _serializer = new QueueMessageSerializer(serializer);
 }
 // ReSharper disable InconsistentNaming
 static void TestConfiguration(IQueueWriter sender, RawEngineBuilder builder)
 {
     int i = 0;
     using (var t = new CancellationTokenSource())
     using (TestObserver.When<MessageAcked>(ea =>
         {
             if (ea.Context.QueueName != "do")
                 return;
             if (i++ >= 5)
                 t.Cancel();
         }))
     using (var engine = builder.Build())
     {
         engine.Start(t.Token);
         sender.PutMessage(new byte[1]);
         if (!t.Token.WaitHandle.WaitOne(5000))
         {
             t.Cancel();
         }
         Assert.IsTrue(t.IsCancellationRequested);
     }
 }
Esempio n. 18
0
 public SendStartupMessage(IQueueWriter queueWriter, IBusDataAccess busDataAccess)
 {
     _queueWriter = queueWriter;
     _dataAccess  = busDataAccess;
 }
 public BrokerControllerCloudQueueClient(IQueueListener <CloudQueueResponseDto> listener, IQueueWriter <CloudQueueCmdDto> writer) : base(listener, writer)
 {
     this.RegisterResponseTypes();
 }
 internal BrokerLauncherCloudQueueWatcher(IBrokerLauncher instance, IQueueListener <CloudQueueCmdDto> listener, IQueueWriter <CloudQueueResponseDto> writer)
 {
     this.instance      = instance;
     this.QueueListener = listener;
     this.QueueWriter   = writer;
     this.QueueListener.MessageReceivedCallback = this.InvokeInstanceMethodFromCmdObj;
     this.RegisterCmdDelegates();
 }
Esempio n. 21
0
 protected CloudQueueClientBase(IQueueListener <CloudQueueResponseDto> listener, IQueueWriter <CloudQueueCmdDto> writer) : this()
 {
     this.Listener = listener;
     this.Writer   = writer;
     this.Listener.MessageReceivedCallback = this.ReceiveResponse;
 }
Esempio n. 22
0
 public BusClient(IQueueWriter commandWriter, IQueueWriter eventWriter)
 {
     _commandWriter = commandWriter;
     _eventWriter = eventWriter;
 }
Esempio n. 23
0
 public MessageSender(IQueueWriter[] queues)
     : this(queues, () => Guid.NewGuid().ToString())
 {
 }
Esempio n. 24
0
 public MessageSender(IEnvelopeStreamer streamer, IQueueWriter queue)
 {
     _queue = queue;
     _streamer = streamer;
 }
Esempio n. 25
0
 public MessageSender(IEnvelopeStreamer streamer, IQueueWriter queue)
 {
     _queue    = queue;
     _streamer = streamer;
 }
 public LegacyTapeStreamEventStore(ITapeContainer factory, IEnvelopeStreamer streamer, IQueueWriter writer)
 {
     _factory = factory;
     _streamer = streamer;
     _writer = writer;
 }
Esempio n. 27
0
 public MouseEventsRequestHandler(IQueueWriter writer, IDataSerializer serializer, IEnvelopeStreamer streamer)
 {
     _writer     = writer;
     _serializer = serializer;
     _streamer   = streamer;
 }
 public MyAnonymousCommandSender(IQueueWriter writer, IDataSerializer serializer, IEnvelopeStreamer streamer)
 {
     _writer = writer;
     _serializer = serializer;
     _streamer = streamer;
 }
Esempio n. 29
0
 public RentalOfferController(IAudit audit, IQueueWriter queueWriter)
 {
     _audit       = audit;
     _queueWriter = queueWriter;
 }
Esempio n. 30
0
 public WebEndpoint(IQueueWriter queueWriter)
 {
     m_queueWriter = queueWriter;
 }
Esempio n. 31
0
 public TasksFactory(IQueueWriter <T> queueWriter)
 {
     this.queueWriter = queueWriter;
 }
Esempio n. 32
0
 public StartMatchHandler(IQueueWriter <PerformAppend> queueWriter, DataUnitOfWork provider)
 {
     _queueWriter = queueWriter;
     _provider    = provider;
 }
 public MouseEventsRequestHandler(IQueueWriter writer, IDataSerializer serializer, IEnvelopeStreamer streamer)
 {
     _writer = writer;
     _serializer = serializer;
     _streamer = streamer;
 }
Esempio n. 34
0
 public FileWriterForCompress(IQueueWriter queueWriter, IGZipProgress gZipProgress)
 {
     _queueWriter     = queueWriter;
     _gZipProgress    = gZipProgress;
     _fileProcessData = FileProcessData.Instance;
 }
Esempio n. 35
0
 public WebEndpoint(NuclearStorage store, IEnvelopeStreamer streamer, IQueueWriter writer)
 {
     _store    = store;
     _streamer = streamer;
     _writer   = writer;
 }
Esempio n. 36
0
 /// <summary>
 /// Writes a message to a queue
 /// </summary>
 public static Task WriteMessage <T>(this IQueueWriter writer, string queueName, T message, DateTime?NotBefore = null)
 {
     return(writer.WriteMessage(queueName, typeof(T), message, NotBefore));
 }
Esempio n. 37
0
 public DefaultMessageSender(IQueueWriter queueWriter)
 {
     _queueWriter = queueWriter;
 }
 public AggregateFactory(ITapeStorageFactory factory, IEnvelopeStreamer streamer, IQueueWriter writer)
 {
     _factory  = factory;
     _streamer = streamer;
     _writer   = writer;
 }
 public BrokerWorkerControllerQueueWatcher(IController instance, IQueueListener <CloudQueueCmdDto> listener, IQueueWriter <CloudQueueResponseDto> writer) : base(listener, writer)
 {
     this.instance = instance;
     this.RegisterCmdDelegates();
 }
Esempio n. 40
0
 public MessageSender(IQueueWriter writer, ISerializer serializer)
     : this(writer, new QueueMessageSerializer(serializer))
 {
 }
Esempio n. 41
0
 public RentalOfferController(IAudit audit, IQueueWriter queueWriter)
 {
     _audit = audit;
     _queueWriter = queueWriter;
 }
		public DefaultMessageSender(IQueueWriter queueWriter)
		{
			_queueWriter = queueWriter;
		}
Esempio n. 43
0
 protected CloudQueueWatcherBase(IQueueListener <CloudQueueCmdDto> listener, IQueueWriter <CloudQueueResponseDto> writer)
 {
     this.QueueListener = listener;
     this.QueueWriter   = writer;
     this.QueueListener.MessageReceivedCallback = this.InvokeInstanceMethodFromCmdObj;
 }
 public MyAnonymousCommandSender(IQueueWriter writer, IDataSerializer serializer, IEnvelopeStreamer streamer)
 {
     _writer     = writer;
     _serializer = serializer;
     _streamer   = streamer;
 }