コード例 #1
0
            public EndpointHandle(ReceiveEndpoint endpoint, ReceiveTransportHandle transportHandle, StartEndpointReadyObserver observer)
            {
                _endpoint = endpoint;
                _observer = observer;

                TransportHandle = transportHandle;
            }
コード例 #2
0
            public async Task Should_be_asynchronous()
            {
                var shutdown = new CancellationTokenSource();

                var inputAddress = new Uri("loopback://localhost/input_queue");

                var transport = new InMemoryTransport(inputAddress, Environment.ProcessorCount);

                TaskCompletionSource <int> received = GetTask <int>();

                IPipe <ReceiveContext> receivePipe = Pipe.New <ReceiveContext>(x =>
                {
                    x.UseFilter(new DelegateFilter <ReceiveContext>(context =>
                    {
                        Console.WriteLine("Message: {0}", context.TransportHeaders.Get("MessageId", "N/A"));

                        received.TrySetResult(1);
                    }));
                });

                ReceiveTransportHandle receiveHandle = ((IReceiveTransport)transport).Start(receivePipe);

                var sendEndpoint = new SendEndpoint(transport, new JsonMessageSerializer(), inputAddress,
                                                    inputAddress);

                await sendEndpoint.Send(new A(), TestCancellationToken);

                await received.Task;

                shutdown.Cancel();

                await receiveHandle.Stop();
            }
コード例 #3
0
 public Handle(ReceiveEndpoint endpoint, ReceiveTransportHandle transportHandle, ReceiveEndpointContext context)
 {
     _endpoint        = endpoint;
     _transportHandle = transportHandle;
     _context         = context;
 }
コード例 #4
0
 public void Start()
 {
     TransportHandle = _transport.Start();
 }
コード例 #5
0
 public Handle(ReceiveTransportHandle transportHandle)
 {
     _transportHandle = transportHandle;
 }
コード例 #6
0
        ReceiveEndpointHandle IReceiveEndpoint.Start()
        {
            ReceiveTransportHandle transportHandle = _receiveTransport.Start(_receivePipe);

            return(new Handle(transportHandle));
        }
コード例 #7
0
 public Handle(ReceiveTransportHandle transportHandle)
 {
     _transportHandle = transportHandle;
 }