Closed monrealis closed 3 years ago
I can use Semaphore of course, but is there anything in a client?
BLOCK still works, but I would recommend using DELAY instead.
How can it work if there is no such class?
MaxCommandAction is an enum.
Ok, now I understand your issue. MaxCommandAction only exists in the C# client. You are trying to find MaxCommandAction in the java client which does not exist.
In the java client, async command throttling is configured via EventPolicy.
MaxCommandAction is an enum.
Enum is a class in Java.
Is there a way to configure event policy so that it works like BLOCK used to work? My conjecture is "No, it can't". Then why was this feature removed? :)
BLOCK can lead to deadlock when a new async command is initiated from a callback in the eventloop thread. Any blocking should be performed outside of the eventloop.
With BLOCK I was able to fulfill use case: write a bunch of records, waiting as long as needed, but not exceeding some load parameters. Now there is no way to do it.
That use case is best supported by the sync API.
I see that this no longer works https://www.aerospike.com/apidocs/java/com/aerospike/client/async/MaxCommandAction.html#BLOCK. Is there an alternative in you client? I cannot find any.