Skip to content

Commit

Permalink
Add async prameter
Browse files Browse the repository at this point in the history
  • Loading branch information
zadockmaloba committed May 3, 2024
1 parent 4982dd4 commit adaef49
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions RPCClient+Invoke.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,24 @@ public partial class RPCClient
public delegate void RPCSuccessCallback(RPCResponse response);
public delegate void RPCFailedCallback(RPCError error);

public string Invoke(RPCRequest request)
public string Invoke(RPCRequest request, bool async=true)
{
_ = PostRequests([request], async: true);
_ = PostRequests([request], async: async);
return request.Id ?? "";
}

public string Invoke(string method, object paramsObj, RPCRequestCallback callback)
public string Invoke(string method, object paramsObj, RPCRequestCallback callback, bool async = true)
{
RPCRequest request = new RPCRequest
{
Method = method,
Params = paramsObj,
Callback = callback
};
return Invoke(request);
return Invoke(request, async: async);
}

public string Invoke(string method, object paramsObj, RPCSuccessCallback successCallback, RPCFailedCallback failedCallback)
public string Invoke(string method, object paramsObj, RPCSuccessCallback successCallback, RPCFailedCallback failedCallback, bool async = true)
{
return Invoke(method, paramsObj, (response) =>
{
Expand All @@ -41,6 +41,6 @@ public string Invoke(string method, object paramsObj, RPCSuccessCallback success
{
successCallback(response);
}
});
}, async: async);
}
}

0 comments on commit adaef49

Please sign in to comment.