jBloomberg icon indicating copy to clipboard operation
jBloomberg copied to clipboard

Multi event subscription

Open jonfreedman opened this issue 6 years ago • 3 comments

  • new DataChangeMultiListener interface can be set on SubscriptionBuilder
  • ConcurrentConflatedEventsManager uses a SetTrie datastructure to find sub-set and super-set listeners for a given CorrelationId and Set<RealtimeField>
    • sub-set's have subscribed to some but not all of the fields in a message
    • super-set's have subscribed to all the fields in a message as well as others - this is needed because some fields are artificially separated e.g. BID/ASK
  • SetTrie implementation is provided with some tests, this may need further development
    • some further tests @ https://github.com/mmihaltz/pysettrie

jonfreedman avatar Sep 26 '18 05:09 jonfreedman

Thanks Jon. It's a significant and structural commit. Would you mind giving a bit of background (use case, why it's needed etc.)?

assylias avatar Sep 26 '18 08:09 assylias

The use case is around processing RealtimeField values which are logically linked together, for example if you subscribe to a fixing e.g. LAST_PRICE and TIME fields on SONIO/N Index you need to process these together in order to remain consistent as the two values change together and represent the level and the date of the fixing. The same applies to BID and LAST_UPDATE_BID_RT on ticking instruments which represent the bid and the clock time of the quote. Without this change it's necessary to attempt to piece these updates back together and that code will be horrible.

jonfreedman avatar Sep 26 '18 08:09 jonfreedman

Looking at some of the tests this use case appears to conflict with some of the existing usage e.g. BloombergSessionAsyncSusbcriptionTest#testFeed subscribes to three fields across two tickers but Bloomberg never sends all three fields together so looking for a sub-set of received fields as a subscription does not work, we actually need to find listeners which have subscribed to a super-set of each individual field in the Bloomberg data.

jonfreedman avatar Sep 26 '18 09:09 jonfreedman