Source/Csla.Channels.RabbitMq/RabbitMqProxy.cs
/// <summary>
/// Create message and send to Rabbit MQ server.
/// Return Response from server
/// </summary>
/// <param name="serialized">Serialised request</param>
/// <param name="operation">DataPortal operation</param>
/// <param name="routingToken">Routing Tag for server</param>
/// <param name="isSync">True if the client-side proxy should synchronously invoke the server.</param>
/// <returns>Serialised response from server</returns>
Create message and send to Rabbit MQ server.
Return Response from server
Create message and send to Rabbit MQ server . Return Response from server
protected override async Task<byte[]> CallDataPortalServer(byte[] serialized, string operation, string routingToken, bool isSync)
    {
      var correlationId = Guid.NewGuid().ToString();
      var resetEvent = new Csla.Threading.AsyncManualResetEvent();
      var wip = Wip.WorkInProgress.GetOrAdd(correlationId, new WipItem { ResetEvent = resetEvent });
      SendMessage(QueueListener.ReplyQueue.QueueName, correlationId, operation, serialized);
      var timeout = Task.Delay(Timeout * 1000);
      if (await Task.WhenAny(wip.ResetEvent.WaitAsync(), timeout) == timeout)
        throw new TimeoutException();
      return wip.Response;
    }
protected override async Task < byte [ ] > CallDataPortalServer ( byte [ ] serialized , string operation , string routingToken , bool isSync ) { var correlationId = Guid . NewGuid ( ) . ToString ( ) ; var resetEvent = new Csla . Threading . AsyncManualResetEvent ( ) ; var wip = Wip . WorkInProgress . GetOrAdd ( correlationId , new WipItem { ResetEvent = resetEvent } ) ; SendMessage ( QueueListener . ReplyQueue . QueueName , correlationId , operation , serialized ) ; var timeout = Task . Delay ( Timeout * 1000 ) ; if ( await Task . WhenAny ( wip . ResetEvent . WaitAsync ( ) , timeout ) == timeout ) throw new TimeoutException ( ) ; return wip . Response ; }
Create message and send to Rabbit MQ server.
Create message and send to Rabbit MQ server .
Serialised response from server
Serialised response from server
serialized
byte[]
None
operation
string
None
routingToken
string
Routing Tag for server
Routing Tag for server
isSync
bool
True if the client-side proxy should synchronously invoke the server.
True if the client - side proxy should synchronously invoke the server .