What's the equivalent of RFA's COMPLETION_EVENT in RTSDK?

RG1
RG1 Explorer

To migrate RFA OMM consumer code to RTSDK/ETA API, what can be used as a COMPLETION_EVENT? We use COMPLETION_EVENT to make sure there are no events queued for subscription before destroying /deallocating objects associated with the subscription. Thank you

Tagged:

Best Answer

  • Jirapongse
    Jirapongse ✭✭✭✭✭
    Answer ✓

    @RG1

    RTSDK doesn't have COMPLETION_EVENT.

    You can destroy objects associated with the stream (subscription) when the stream has been closed. There are two ways to close the steams.

    1. The stream has been closed by the provider. In this case, you can check the stream state of the stream by calling the rsslIsFinalState method to determine whether the RsslState represents a final state for a stream. You can destroy objects associated with the stream when the rsslIsFinalState method returns true for that stream.

    2. The stream has been unsubscribed by the consumer. The consumer can unsubscribe items by sending the RsslCloseMsg. You need to specify the stream ID in the RsslCloseMsg. After sending the close message, you can destroy objects associated with that stream. However, it is also possible to retrieve update messages of that stream due to race conditions. The application must ignore the update messages of the streams that have been closed.