Datascope select asynchronous requests best practice
Given that the datascope select api typically has a rate limit duration of 60 seconds, why would I have a wait time of less than 60 seconds on an asynchronous request, given that the request will be returned as soon as a result is available anyway?
Take the following example, an asynchronous request takes exactly 45 seconds to complete. If I have a wait time (default) of 30 seconds, then I will make 2 requests to the api within the 45 second period. However, if I have a wait time of 60 seconds, I will only make 1 request. In both cases, I will still receive the response within 45 seconds.
I feel that I must be missing something here, so would appreciate some info on this. Thanks.
Best Answer
-
Hi @david.p.newman,
You are correct that the server will respond as soon as the data is ready. So what are the disadvantages of using extremely long timeouts in the requests:
1. The networking modules will block the code execution until the timeout period or a response is received. This can be circumvented by use of asynchronous IO libraries.
2. The network connection without traffic may be dropped by intermediaries like routers and firewalls, thereby loosing the response.
A timeout of 60 or 120 seconds is a good balance for long running queries.
0
Answers
-
Thank you for reaching out to us.
I assume that you already knew that the wait time is configurable via the HTTP header.
Prefer: respond-async, wait=120
For more information, please refer to the DSS Key Mechanism document.
As far as I know, the extraction time is varied due to many factors, such as the number of instruments, the number of content fields, the data and time range, and server load. It should not be exactly 45 seconds for every request.
You need to adjust it according to your requirement. You can also refer to the LSEG DataScope Select Best Practices & Fair Usage Policy document.
0 -
Thanks for the reply. Yes, I am aware of the wait=120 and I have read the documentation (although it's possible I've missed something!).
However, as per my example, I cannot comprehend why I would ever have a wait time of less than 60 seconds, given that the api will respond as soon as a response is ready. I guess one reason might be if my local process itself is asynchronous and I don't want to wait 60 seconds for a response. I guess my point is really that the advantage of having a wait time or more than 60 seconds, is that I don't "waste" a request from my quota, in the event that the response takes longer than the wait time.0
Categories
- All Categories
- 6 AHS
- 37 Alpha
- 161 App Studio
- 4 Block Chain
- 4 Bot Platform
- 16 Connected Risk APIs
- 47 Data Fusion
- 30 Data Model Discovery
- 608 Datastream
- 1.3K DSS
- 577 Eikon COM
- 4.9K Eikon Data APIs
- 7 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- Trading API
- 2.7K Elektron
- 1.3K EMA
- 236 ETA
- 519 WebSocket API
- 33 FX Venues
- 10 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 20 Messenger Bot
- 2 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 59 Open Calais
- 264 Open PermID
- 39 Entity Search
- 2 Org ID
- PAM
- PAM - Logging
- 8.4K Private Comments
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 20 RDMS
- 1.4K Refinitiv Data Platform
- 367 Refinitiv Data Platform Libraries
- 3 Refinitiv Due Diligence
- LSEG Due Diligence Portal API
- 3 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.1K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 10 World-Check Customer Risk Screener
- 990 World-Check One
- 44 World-Check One Zero Footprint
- 45 Side by Side Integration API
- Test Space
- 3 Thomson One Smart
- 1.2K TR Internal
- Global Hackathon 2015
- 2 Specialists Who Code
- 10 TR Knowledge Graph
- 150 Transactions
- 142 REDI API
- 1.7K TREP APIs
- 4 CAT
- 21 DACS Station
- 117 Open DACS
- 1.1K RFA
- 103 UPA
- 172 TREP Infrastructure
- 224 TRKD
- 886 TRTH
- 5 Velocity Analytics
- 5 Wealth Management Web Services
- 59 Workspace SDK
- 9 Element Framework
- 5 Grid
- 13 World-Check Data File
- Yield Book Analytics
- 46 中文论坛