Ejemplo n.º 1
0
 public DisplayOnPacketEnqueued(NodeIdentifier nodeId, IObservable <NetworkEvent> networkEvents, PacketTypeReadModel packetTypeReadModel, IDisplayPacketEnqueue consumerPacket)
 {
     networkEvents
     .OfType <NetworkEvent, NetworkEvent.PacketEnqueued>()
     .Where(packetEnqued => packetEnqued.NodeId == nodeId)
     .Select(packetEnqued => packetTypeReadModel[packetEnqued.PacketId])
     .Do(packetEnqueued => Debug.Log($"Packet Enqueued {packetEnqueued}"))
     .Subscribe(color => consumerPacket.EnqueuePacket(color));
 }
Ejemplo n.º 2
0
 public DisplayOnPacketDequeued(NodeIdentifier nodeId, IObservable <NetworkEvent> networkEvents, PacketTypeReadModel packetTypeReadModel, IDisplayPacketEnqueue consumerPacket)
 {
     networkEvents
     .OfType <NetworkEvent, NetworkEvent.PacketDequeued>()
     .Where(packetDequed => packetDequed.NodeId == nodeId)
     .Subscribe(color => consumerPacket.DequeuePacket());
 }