Comments (9)
I am not sure if I follow.
public static final RateLimitRule IP_WEB_SOCKET_CONNECTION_RULE =
RateLimitRule.newBuilder()
.setName("ip_web_socket_connection_rule")
.setType(IP)
.setMaxPermits(20)
.setResetPeriod(Duration.ofHours(1))
.build();
This code should limit WebSocket connection to 20 per hour. I think you are concerning that OkHttpClient's auto-retry feature may silently retry and break rate limit.
If this is the case, the proper solution shall be setting OkHttpClient's "retryOnConnectionFailure" field to false?
from io.contek.invoker.
Please check this line
it does not take into account provided resetPeriod, actually resetPeriod is not used anywhere.
from io.contek.invoker.
You are right indeed. That was a terrible bug. Will fix and release 2.7.5-SNAPSHOT.
Your comment is much appreciated.
from io.contek.invoker.
Also this line
returns false if acquisition failed due to Timeout, default is 5 seconds, if acquire returns false it needs to bubble up (true/false result) to the caller and abandon the request if acquire returned false.
Right now this method relies on Thread.park
of acquirePermission()
method, but in 5 seconds it releases park and request is submitted every 5 seconds
from io.contek.invoker.
I would be happy to add PR but i need you Intellij code formatting preset
from io.contek.invoker.
I am using google-java-format plugin, which is free from Intellij plugin Market Place. It actually does more than the out-of-box IntelliJ code style. I also recommend "Save Action" plugin.
Regarding the new issue you pointed out. I will need to investigate a bit further before I can fix it. I will be very grateful if you can do a PR for this. Thanks!
from io.contek.invoker.
Changing that line to RateLimiter.waitForPermission(limiter, permits);
Will this be enough?
from io.contek.invoker.
Yep perfect, tested - does to job. Although to completely support Bitmex Bucket Re-Fill algorithm it needs a bit more play, but this is good enough. You guys have really some high quality lib here.
from io.contek.invoker.
Awesome. The fix is included in 2.7.7-SNAPSHOT. Your contribution is much appreciated!
from io.contek.invoker.
Related Issues (20)
- Break statement HOT 3
- BigDecimal vs Double HOT 3
- Wrong endpoint path HOT 1
- 你好 HOT 1
- FTX rate limits HOT 1
- Primitives in response models HOT 1
- Gate.io support
- Correct JDK version HOT 1
- Binance spot Order Book Ticker API returns an object instead of array
- Incorrect import
- Inconsistent dependencies in okhttp
- Different between bybitliner and bybit
- 怎么用?
- 批量下单撤单功能
- binancelinear WebSocketCommand should be public
- ForceOrderEvent.Order wrong filed
- Bitmex _Instrument missing fields
- Bybit linear open_interest should be Double
- Add Bybit V5 API HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from io.contek.invoker.