I’m currently working with the TypeScript Ontology SDK (OSDK) and exploring the subscriptions feature as documented here: Subscribe to Ontology changes with the TypeScript OSDK. While the documentation provides a good overview of how to set up subscriptions to receive updates when objects in a specified object set change, I’m curious about the underlying mechanics of how these subscriptions operate.
Specifically, I have a few questions:
- Mechanism of Receiving Updates: When I set up a subscription in my OSDK application running as a web server, how does it actually receive updates? Is the SDK employing a polling mechanism under the hood, or are updates pushed to the application in real-time?
- Reliability and Guarantees: What guarantees does the OSDK provide regarding the delivery of updates? For instance, is there a possibility of missing updates if the application experiences downtime, or does the SDK handle reconnection and state synchronization to ensure consistency?
- Cleanup and Subscription Management: The
.subscribe()
method returns an object with anunsubscribe()
function. I’m interested in understanding how the cleanup process works, especially in scenarios where the application crashes or is terminated unexpectedly. Do I need to implement a mechanism to track and manage subscriptions, perhaps storing them in a database, to ensure that there are no lingering subscriptions or resource leaks on the server side?
Understanding these aspects is crucial for me to design my application architecture effectively and ensure data consistency. If anyone has insights or experiences to share regarding the internal workings of OSDK subscriptions, I would greatly appreciate your input.
Thanks in advance!