private async Task ServiceReceivedAsync(object sender, global::RabbitMQ.Base.EventArgsT <CallSession> e) { _busyFlag.Increment(); try { await using var connection = new RabbitMQServiceConnection(e.Value); await _requestHandler.HandleAsync(connection, ChannelType.RabbitMQ); } finally { _busyFlag.Decrement(); } }
public override async Task DuplexStreamingServerMethod(IAsyncStreamReader <StreamBuffer> requestStream, IServerStreamWriter <StreamBuffer> responseStream, ServerCallContext context) { _busyFlag.Increment(); await using var connection = new GrpcServiceConnection(requestStream, responseStream, _logger); try { await _requestHandler.HandleAsync(connection, ChannelType.Grpc); } finally { _busyFlag.Decrement(); } }
private async void ServiceReceived(object sender, global::RabbitMQ.Base.EventArgsT <CallSession> e) { _busyFlag.Increment(); try { #if NETSTANDARD2_1 || NETCOREAPP3_1 await #endif using var connection = new RabbitMQServiceConnection(e.Value); await _requestHandler.HandleAsync(connection); } finally { _busyFlag.Decrement(); } }
public override async Task DuplexStreamingServerMethod(IAsyncStreamReader <StreamBuffer> requestStream, IServerStreamWriter <StreamBuffer> responseStream, ServerCallContext context) { _busyFlag.Increment(); GrpcServiceConnection connection = null; try { connection = new GrpcServiceConnection(requestStream, responseStream, _logger); await _requestHandler.HandleAsync(connection); } finally { if (connection != null) { await connection.AllDisposeAsync(); } _busyFlag.Decrement(); } }