RFA.NET Snapshot - Synchonous
Hi,
I am trying to understand what is the most efficient way to do snapshots using RFA.NET
I am looking at the example Examples\OrderBookAndMarketPriceBag\OrderBookAndMarketPriceBag. In the MarketPriceWrapper class, there is a method to call Snapshot but it seems to be asynchronous.
1. Can we have an example of how to call snapshot in a synchronous way?
2. Is there a way to know that a snapshot is completed?
3. Is there any timeout we can put so if it takes too long, then we cancel the snapshot request?
4. If snapshot is incomplete, is there a way to know what data is missing?
Thanks!
Best Answer
-
Hi
In RFA a Snapshot is just a flag set in the request, it means we want only initial refresh message (not the updates), all the remaining code is the same.
You can 'emulate' a synchronous request using a method where you make a loop calling eventQueue dispatch, for instance:
// send Snapshot request
...
reqMsg.InteractionType = ReqMsg.InteractionTypeFlag.InitialImage;
handle = Context.OMMConsumer.RegisterClient(Context.EventQueue, ommItemIntSpec, this, closurel);
// wait data for 'timeoutSeconds'
System.DateTime currentTime = System.DateTime.Now;
System.DateTime endTime = currentTime.AddSeconds(timeoutSeconds);
receivedSnap = false;
while ((!receivedSnap) && (currentTime < endTime))
{
eventQueue.Dispatch(dispatchTimeOutInterval);
currentTime = System.DateTime.Now;
}
Somewhere in your processEvent() when the snap is receivede you set receiveSna=true.
public void ProcessEvent(Event evnt)
{
switch (evnt.Type)
{
case SessionLayerEventTypeEnum.OMMItemEvent:
// extract event data
receivedSnap = true;
break;
default:
break;
}
}
In a scenario with multiple request you will need maybe a Dictionary to store the receivedSnap flag for each request. (you can use the closure parameter to help identify from which ric the refresh refers to, etc).
It would be inefficient to request and wait each ric image at a time.
Paulo.2
Answers
-
Thanks - I will need to look into more details the dispatch method and also dispatchTimeOutInterval parameter. In our case, we have indeed multiple request - up to 800 Rics for a snapshot. So I am trying to find the most efficient way to do so.
0
Categories
- All Categories
- 6 AHS
- 38 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 中文论坛