コード例 #1
0
        public Task Dispatch(TransportOperations outgoingMessages, TransportTransaction transaction, ContextBag context)
        {
            foreach (var transportOperation in outgoingMessages.UnicastTransportOperations)
            {
                var destination = new InMemoryDestination(transportOperation.Destination);
                SharedStorage.Instance.Send(destination, transportOperation.Message, transportOperation.DeliveryConstraints);
            }

            foreach (var transportOperation in outgoingMessages.MulticastTransportOperations)
            {
                SharedStorage.Instance.Publish(transportOperation.Message, transportOperation.MessageType);
            }

            return(Task.CompletedTask);
        }
コード例 #2
0
        public void Send(InMemoryDestination destination, OutgoingMessage message, List <DeliveryConstraint> constraints)
        {
            var storage = this.endpointStorage.GetOrAdd(destination.EndPoint, new EndpointStorage(destination.EndPoint));

            storage.Enqueue(message, constraints);
        }