Hi Pietro Yes, sendAsync method is thread safe. But with parallel invocations, the client only guarantees the order in which requests are executed by the api. If you require your client requests to be ordered, you should sequence the calls to the api in the order you want them to be executed by server.
For example if you have requests r1, r2 and r3 and they should be executed in the order (r1 before r2 before r3) then your calls to the api should be in the order. sendAsync(r1) -> sendAsync(r2) -> sendAsync(r3) sendAsync is a non-blocking api and should be a lightweight call. You should be able to call it multiple times from the same thread. Thanks Lokesh > On 03-Dec-2020, at 4:04 PM, Pietro Tollot <[email protected]> wrote: > > Hi all, > > i have a doubt in the parallel utilisation of the RaftClient, one question > is: is the sendAnsyc method of the RaftClient thread safe? > For achieving the best performance by the library, i have seen in the > presentation page roughly 10’000 transactions per second, if i have seen > correctly, it is correct to use a single RaftClient in which to perform > parallel invocations of the sendAsync method? (All my sends are performed by > the same replica) > > Thanks
