internal PendingRequest <T> Request <T>(string methodName, object[] args, Func <object?, T> parser) { var id = System.Threading.Interlocked.Increment(ref msgid); var send = new JsonRpc.Request(id, methodName, args); var track = new Tracked <T>(parser); lock (pending) { pending.Add(id, track); } return(new PendingRequest <T>(send, track.Task)); }
internal PendingRequest(JsonRpc.Request request, Task <T> task) { this.request = request; this.task = task; }