public MessageStateMachine(IMusicTrackDatabase musicDatabase) { this.messageRegister = new MessageRegister(); this.messageBuilder = new MessageBuilder(musicDatabase); this.messageHistory = new MessageHistory(); this.statisticsManager = new StatisticsManager(); }
public void Setup() { _publisher = new Publisher <IMyMessage>(); _messageHistory = new MyMessageHistory(); _handler = new MyMessageHandler(); _handler2 = new MyMessageHandler(); }
public void Deliver(IMessageHistory <TConstraint> history) { foreach (var subscriber in _subscribers) { ((ISubscriber <TConstraint>)subscriber).Deliver(history); } }
public ServerSentEvent(int noOfMessagesToRemember, bool generateMessageIds = false, int heartbeatInterval = 0) { mHeartbeatInterval = heartbeatInterval; mMessageHistory = new MemoryMessageHistory(noOfMessagesToRemember); if (generateMessageIds) mIdGenerator = new SimpleIdGenerator(); SetupHeartbeat(heartbeatInterval); }
public void Deliver(IMessageHistory <TConstraint> history) { while (_messages.Count > 0) { var message = _messages.Dequeue(); HandleDelivery(message); history.Push(new MessageEnvelope <TConstraint>(message)); } }
public ServerSentEvent(int noOfMessagesToRemember, bool generateMessageIds = false, int heartbeatInterval = 0) { mHeartbeatInterval = heartbeatInterval; mMessageHistory = new MemoryMessageHistory(noOfMessagesToRemember); if (generateMessageIds) { mIdGenerator = new SimpleIdGenerator(); } SetupHeartbeat(heartbeatInterval); }
public ServerSentEvent(IMessageHistory messageHistory, IMessageIdGenerator idGenerator, int heartbeatInterval = 0) { if (messageHistory == null) throw new ArgumentException("messageHistory can not be null."); if (idGenerator == null) throw new ArgumentException("idGenerator can not be null."); mMessageHistory = messageHistory; mIdGenerator = idGenerator; mHeartbeatInterval = heartbeatInterval; SetupHeartbeat(heartbeatInterval); }
public ServerSentEvent(IMessageHistory messageHistory, IMessageIdGenerator idGenerator, int heartbeatInterval = 0) { if (messageHistory == null) { throw new ArgumentException("messageHistory can not be null."); } if (idGenerator == null) { throw new ArgumentException("idGenerator can not be null."); } mMessageHistory = messageHistory; mIdGenerator = idGenerator; mHeartbeatInterval = heartbeatInterval; SetupHeartbeat(heartbeatInterval); }
internal void SetMessageHistory(IMessageHistory messageHistory) { this.messageHistory = messageHistory; }
public ServerSentEvent(IMessageHistory messageHistory, IMessageIdGenerator idGenerator, int heartbeatInterval = 0) : base(messageHistory, idGenerator, heartbeatInterval) { }