public EndpointHandle(ReceiveEndpoint endpoint, ReceiveTransportHandle transportHandle, StartEndpointReadyObserver observer) { _endpoint = endpoint; _observer = observer; TransportHandle = transportHandle; }
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(); }
public Handle(ReceiveEndpoint endpoint, ReceiveTransportHandle transportHandle, ReceiveEndpointContext context) { _endpoint = endpoint; _transportHandle = transportHandle; _context = context; }
public void Start() { TransportHandle = _transport.Start(); }
public Handle(ReceiveTransportHandle transportHandle) { _transportHandle = transportHandle; }
ReceiveEndpointHandle IReceiveEndpoint.Start() { ReceiveTransportHandle transportHandle = _receiveTransport.Start(_receivePipe); return(new Handle(transportHandle)); }