public IEventProcessorConfiguration RegisterEventHandlers(IMessagePump receiver, params Type[] types) { RegisterEventHandlers(receiver, new ArrayMessageHandlerRegistration <IEventHandler>(typeof(IEventHandler <>), types)); // Continue. return(this); }
protected MessageProcessor( DispatcherQueueSetting setting, IReliableLog <TMessage> inputMessageQueue, IReliableLog <OutputMessage> outputMessageQueue, IMessageFilteringEngine <TMessage> filteringEngine, IResultReporter resultReporter) : base(nameof(MessageProcessor <TMessage>)) { this.setting = setting; this.inputMessageQueue = inputMessageQueue; this.outputMessageQueue = outputMessageQueue; this.filteringEngine = filteringEngine; this.resultReporter = resultReporter; this.processorComponents = new ComponentManager(this.setting.Name, "MessageProcessorContainer"); this.processorComponents.Faulted += (s, e) => this.Fault(e.Exception); this.messageDispatcher = MessageDispatcher.Create( this.setting, this.outputMessageQueue, this.resultReporter); this.processorComponents.Add(this.messageDispatcher); this.messagePump = MessagePump <TMessage> .Create( this.setting, this.inputMessageQueue, this.filteringEngine, this.messageDispatcher); this.processorComponents.Add(this.messagePump); }
public SensorePressione(string descrizione = null) { Descrizione = descrizione; Random ran = new Random(); Timer timer = new Timer(ran.Next(120*1000,600*1000)); timer.Elapsed += CambiamentoPressione; mess = MessagePump.GetMessagePump(); }
public IEventProcessorConfiguration RegisterEventHandler <TEventHandler>(IMessagePump receiver) where TEventHandler : IEventHandler { RegisterEventHandlers(receiver, new TypeMessageHandlerRegistration <IEventHandler>(typeof(IEventHandler <>), typeof(TEventHandler))); // Continue. return(this); }
//argomenti opzionali public Cisterna(double portata = 0, double capienza = 0) { if (portata < 0 || capienza < 0) throw new ArgumentException("Valore di portata o capienza non accettabile"); Portata = portata; Capienza = capienza; _guid = new Guid(); _mess = MessagePump.GetMessagePump(); }
protected override void OnLoad(EventArgs e) { base.OnLoad(e); _messagePump = MessagePump.GetMessagePump(); _notificheTextBox.Clear(); foreach (string notifica in _messagePump.GetAllMEssages()) { _notificheTextBox.AppendText(notifica + Environment.NewLine); } }
public IEventProcessorConfiguration RegisterEventHandlers(IMessagePump receiver, IMessageHandlerRegistration <IEventHandler> registrationSource) { foreach (var registration in registrationSource.GetRegistrations()) { AddMessageType(receiver, registration.Key, registration.Value.ToArray()); } // Continue. return(this); }
public MetricObject(IMonik monik, IRepository repository, IMessagePump pump) { _monik = monik; _repository = repository; _pump = pump; _dto = null; _measures = null; window = null; }
public static void Initialize(IMessagePump messagePump) { if (messagePump == null) { throw new ArgumentNullException(nameof(messagePump)); } globalMessagePump = messagePump; globalMessagePump.MessageReceived += globalMessagePump_MessageReceived; messagePumpSubscription = globalMessagePump.Start(); }
public static EntityManager <TEntity> Create <TEntity>(TEntity entity, IMessagePump messagePump) where TEntity : notnull { var idProperty = entity.GetType().GetProperty("Id"); if (idProperty == null) { throw new InvalidOperationException("Entity has no ID and topic is not provided."); } return(Create(entity, messagePump, idProperty.GetValue(entity).ToString())); }
public AGSRuntimeSettings(IGameSettings settings, IGameWindow gameWindow, IMessagePump messagePump, IGLUtils glUtils) { _glUtils = glUtils; _gameWindow = gameWindow; _messagePump = messagePump; Title = settings.Title; VirtualResolution = settings.VirtualResolution; Vsync = settings.Vsync; PreserveAspectRatio = settings.PreserveAspectRatio; WindowState = settings.WindowState; WindowBorder = settings.WindowBorder; }
public AGSGame(IGameState state, IGameEvents gameEvents, IRenderMessagePump renderMessagePump, IUpdateMessagePump updateMessagePump, IGraphicsBackend graphics, IGLUtils glUtils) { _renderMessagePump = renderMessagePump; _renderMessagePump.SetSyncContext(); _updateMessagePump = updateMessagePump; State = state; Events = gameEvents; _relativeSpeed = state.Speed; _graphics = graphics; _glUtils = glUtils; GLUtils = _glUtils; }
public IEventProcessorConfiguration RegisterEventHandlers(IMessagePump receiver, Action <IFluentMessageHandlerRegistration <IEventHandler> > config) { // Create configuration object and call external configuration. var handlers = new FluentMessageHandlerRegistration <IEventHandler>(typeof(IEventHandler <>)); config(handlers); // Register handlers. RegisterEventHandlers(receiver, handlers); // Continue. return(this); }
public AGSGame(IGameState state, IGameEvents gameEvents, IMessagePump messagePump, IGraphicsBackend graphics, IGLUtils glUtils) { _messagePump = messagePump; _messagePump.SetSyncContext(); State = state; Events = gameEvents; _relativeSpeed = state.Speed; _renderEventArgs = new AGSEventArgs(); _graphics = graphics; _glUtils = glUtils; GLUtils = _glUtils; }
public static EntityManager <TEntity> Create <TEntity>(TEntity entity, IMessagePump pump, string topic) where TEntity : notnull { if (string.IsNullOrWhiteSpace(topic)) { throw new ArgumentOutOfRangeException(nameof(topic), $"{nameof(topic)} cannot be empty!"); } var manager = new EntityManager <TEntity>(entity, topic); manager.Connect(pump); pump.Connect(topic ?? string.Empty, manager); return(manager); }
public MessagePumpsManager(IMessagePump responseMessagePump, IEnumerable <IMessagePump> requestMessagePumps, IEnumerable <IMessagePump> commandMessagePumps, IEnumerable <IMessagePump> multicastRequestMessagePumps, IEnumerable <IMessagePump> multicastEventMessagePumps, IEnumerable <IMessagePump> competingEventMessagePumps) { _responseMessagePump = responseMessagePump; _commandMessagePumps = commandMessagePumps.ToArray(); _requestMessagePumps = requestMessagePumps.ToArray(); _multicastRequestMessagePumps = multicastRequestMessagePumps.ToArray(); _multicastEventMessagePumps = multicastEventMessagePumps.ToArray(); _competingEventMessagePumps = competingEventMessagePumps.ToArray(); }
public MessagePumpsManager(IMessagePump responseMessagePump, IEnumerable<IMessagePump> requestMessagePumps, IEnumerable<IMessagePump> commandMessagePumps, IEnumerable<IMessagePump> multicastRequestMessagePumps, IEnumerable<IMessagePump> multicastEventMessagePumps, IEnumerable<IMessagePump> competingEventMessagePumps) { _responseMessagePump = responseMessagePump; _commandMessagePumps = commandMessagePumps.ToArray(); _requestMessagePumps = requestMessagePumps.ToArray(); _multicastRequestMessagePumps = multicastRequestMessagePumps.ToArray(); _multicastEventMessagePumps = multicastEventMessagePumps.ToArray(); _competingEventMessagePumps = competingEventMessagePumps.ToArray(); }
public Application( IMessageQueue messageQueue, IMessagePump messagePump, IMessageStore messageStore) { _messageQueue = messageQueue; _messagePump = messagePump; _messageStore = messageStore; _messageHandlers = new ComputedDictionary <Guid, IMessageHandler>( () => new List <IMessageHandler> { _board }.Union(_board.Cards) .ToDictionary(h => h.GetObjectId())); }
public static EntityManager <TEntity> Create <TEntity>(TEntity entity, string idPropertyName, IMessagePump pump) where TEntity : notnull { var idProperty = entity.GetType().GetProperty(idPropertyName) ?? throw new ArgumentOutOfRangeException(nameof(idPropertyName), $"Property {idPropertyName} does not exist on {entity.GetType()}"); var topic = idProperty.GetValue(entity).ToString(); return(Create(entity, pump, topic)); }
/// <summary> /// Start the receiver. /// </summary> /// <param name="receiver"></param> /// <param name="handlerMap"></param> private void StartReceiver(IMessagePump receiver, MessageHandlerMap handlerMap) { MessagingEventSource.Log.MessageReceiverStarting(receiver, handlerMap); receiver.StartAsync(message => OnHandleMessage(receiver, null, message, handlerMap), OnError, new ServiceBus.Receive.OnMessageOptions { AutoComplete = false }).Wait(); }
public static ICommandProcessorConfiguration RegisterCommandHandlers(this ICommandProcessorConfiguration configuration, IMessagePump receiver, params Type[] types) { configuration.RegisterCommandHandlers(receiver, new ArrayMessageHandlerRegistration <ICommandHandler>(typeof(ICommandHandler <>), types)); // Continue. return(configuration); }
public static ICommandProcessorConfiguration RegisterCommandHandler <TCommandHandler>(this ICommandProcessorConfiguration configuration, IMessagePump receiver) where TCommandHandler : ICommandHandler { configuration.RegisterCommandHandlers(receiver, new TypeMessageHandlerRegistration <ICommandHandler>(typeof(ICommandHandler <>), typeof(TCommandHandler))); // Continue. return(configuration); }
public static Task StartAsync(this IMessagePump pump, OnMessage messageHandler) { return(pump.StartAsync(messageHandler, null, null)); }
public static Task StartAsync(this IMessagePump pump, OnMessage messageHandler, OnMessageException exception) { return(pump.StartAsync(messageHandler, exception, null)); }
public static Task StartAsync(this IMessagePump pump, OnMessage messageHandler, OnMessageOptions options) { return(pump.StartAsync(messageHandler, null, options)); }
public static ICommandProcessorConfiguration RegisterCommandHandlers(this ICommandProcessorConfiguration configuration, IMessagePump receiver, Action <IFluentMessageHandlerRegistration <ICommandHandler> > config) { // Create configuration object and call external configuration. var handlers = new FluentMessageHandlerRegistration <ICommandHandler>(typeof(ICommandHandler <>)); config(handlers); // Register handlers. configuration.RegisterCommandHandlers(receiver, handlers); // Continue. return(configuration); }
public void Connect(IMessagePump messagePump) { _messagePump = messagePump; }
public NotificationPipeline(IMessagePump pump, LoadContextModel load, ProcessNotification process) { _pump = pump; _load = load; _process = process; }
/// <summary> /// Start the receiver. /// </summary> /// <param name="receiver"></param> /// <param name="handlerMap"></param> private void StartReceiver(IMessagePump receiver, MessageHandlerMap handlerMap) { MessengerEventSource.Log.MessageReceiverStarting(receiver, handlerMap); receiver.StartAsync(message => OnHandleMessage(receiver, null, message, handlerMap), OnError).Wait(); }