Java restrictions
•
Java
How to use the combination of scheduledthreadpoolexecutor, scheduledfuture and executorcompletionservice to restrict callable commands that accept variable parameters? After receiving the response from the callable command, I need to create a new callable command based on the output of the callable command mentioned earlier I also need to stick to the threshold of 100 calls per second
Solution
You should implement the leaky bucket algorithm Prevent you from having a token before calling You can implement this algorithm in dozens of lines of Java
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码