Public Member Functions | |
| std::shared_ptr< SyncSubscription > | register_subscription (std::string query, nlohmann::json query_args=nullptr) |
Installs and returns a sync subscription for a query, configuring Ditto to receive updates from other peers for documents matching that query. The provided query must be a SELECT query. | |
| std::set< std::shared_ptr< SyncSubscription > > | get_subscriptions () const |
| Returns a snapshot of all active subscriptions. | |
Public Attributes | |
| DITTO_DEPRECATED std::set< std::shared_ptr< SyncSubscription > > | subscriptions |
| Set of active subscriptions. | |
| std::shared_ptr< SyncSubscription > ditto::Sync::register_subscription | ( | std::string | query, |
| nlohmann::json | query_args = nullptr ) |
Installs and returns a sync subscription for a query, configuring Ditto to receive updates from other peers for documents matching that query. The provided query must be a SELECT query.
| query | a string containing a valid query expressed in DQL. |
| arguments | a dictionary of values keyed by the placeholder name without the leading :. Example: {{"mileage", 123}}. |
SyncSubscription for the provided query and arguments. You'll have to keep it to be able to cancel the replication subscription, i.e. remove it from the store again. Otherwise it will remain active until Ditto goes out of scope. | DITTO_DEPRECATED std::set<std::shared_ptr<SyncSubscription> > ditto::Sync::subscriptions |
Set of active subscriptions.
This member should not be accessed by client code. Its contents are managed by the owning Sync instance and will be mutated whenever a subscription is created, canceled, or destroyed.