コード例 #1
0
 static void ProcessRequests <TCommand, TRequest, TResponse>(ICommandMetaclass <TCommand, TRequest, TResponse> metaclass, ConcurrentQueue <CommandRequestOp <TCommand, TRequest> > requestOps) where TCommand : ICommandMetaclass
 {
     while (requestOps.Count > 0)
     {
         if (requestOps.TryDequeue(out var op))
         {
             connection.SendCommandRequest(metaclass, op.EntityId, op.Request, null, commandParameterNoShortCircuit);
         }
     }
 }
コード例 #2
0
        static void ProcessResponses <TCommand, TRequest, TResponse>(ICommandMetaclass <TCommand, TRequest, TResponse> metaclass, ConcurrentQueue <CommandResponseOp <TCommand, TResponse> > responseOps) where TCommand : ICommandMetaclass
        {
            while (responseOps.Count > 0)
            {
                if (responseOps.TryDequeue(out var op))
                {
                    var id = new RequestId <IncomingCommandRequest <TCommand> >(op.RequestId.Id);

                    connection.SendCommandResponse(metaclass, id, op.Response.Value);
                }
            }
        }
コード例 #3
0
        static void ProcessRequests <TCommand, TRequest, TResponse>(ICommandMetaclass <TCommand, TRequest, TResponse> metaclass, ConcurrentQueue <CommandRequestOp <TCommand, TRequest> > requestOps, ConcurrentDictionary <long, long> requestIds) where TCommand : ICommandMetaclass
        {
            while (requestOps.Count > 0)
            {
                if (requestOps.TryDequeue(out var op))
                {
                    var outgoingRequest = connection.SendCommandRequest(metaclass, op.EntityId, op.Request, null, commandParameterNoShortCircuit);

                    requestIds[outgoingRequest.Id] = op.EntityId.Id;
                }
            }
        }