void CallAsyncDeferred(Task t) { lock (_writeLock) { IRedisAsyncCommandToken token; if (!_asyncWriteQueue.TryDequeue(out token)) { throw new Exception(); } _asyncReadQueue.Enqueue(token); var args = _asyncTransferPool.Acquire(); int bytes; try { bytes = _io.Writer.Write(token.Command, args.Buffer, args.Offset); } catch (ArgumentException) { throw new RedisClientException($"Could not write command '{token.Command.Command}'. Argument size exceeds buffer allocation of {args.Count}."); } args.SetBuffer(args.Offset, bytes); if (!_redisSocket.SendAsync(args)) { OnSocketSent(args); } } }