Ditto 5.0.0
Loading...
Searching...
No Matches
DittoSDK.Sync.DittoSyncSubscription Class Reference

A sync subscription configures Ditto to receive updates from remote peers about documents matching the subscription's query. More...

Inheritance diagram for DittoSDK.Sync.DittoSyncSubscription:
DittoSDK.Internal.Drop

Public Member Functions

void Cancel ()
 Cancels the sync subscription so that new changes matching the query are no longer received from other peers. No-op if it's already cancelled or the owning Ditto object goes out of scope.
override bool Equals (object obj)
override int GetHashCode ()
Public Member Functions inherited from DittoSDK.Internal.Drop
void Dispose ()
 Suppresses finalization and initiates custom disposal logic.

Static Public Member Functions

static bool operator== (DittoSyncSubscription a, DittoSyncSubscription b)
static bool operator!= (DittoSyncSubscription a, DittoSyncSubscription b)

Protected Member Functions

override unsafe void Dispose (bool disposing)
Protected Member Functions inherited from DittoSDK.Internal.Drop
void Dispose (bool disposing)
 Overload for types to dispose of resources, regardless of whether the type is being disposed or finalized. Note that finalization occurs on a dedicated thread.

Properties

Ditto Ditto [get]
 Gets the Ditto instance this subscription belongs to.
string QueryString [get]
 Gets the query string of the sync subscription (as passed while registering it).
Dictionary< string, object > QueryArguments [get]
 Gets the query arguments of the sync subscription (as passed while registering it).
byte[] QueryArgumentsCborData [get]
 Gets the query arguments of the sync subscription, encoded as CBOR.
string QueryArgumentsJsonString [get]
 Gets the query arguments of the sync subscription, encoded as a JSON string.
bool IsCancelled [get]
 Gets a value indicating whether the sync subscription has been cancelled or not. Also, a sync subscription is considered cancelled if the owning Ditto object goes out of scope.
Properties inherited from DittoSDK.Internal.Drop
bool IsDisposed [get]

Detailed Description

A sync subscription configures Ditto to receive updates from remote peers about documents matching the subscription's query.

Create a sync subscription by calling DittoSync.RegisterSubscription. The subscription will remain active until either explicitly cancelled or the owning Ditto object goes out of scope or Cancel() is called.

Property Documentation

◆ QueryArguments

Dictionary<string, object> DittoSDK.Sync.DittoSyncSubscription.QueryArguments
get

Gets the query arguments of the sync subscription (as passed while registering it).

The returned value is not guaranteed to be strictly equal to the value provided when making the call to DittoSync.RegisterSubscription, as the arguments will have gone through a serialization roundtrip. This might affect equality checks, particularly for non-primitive values. If you want to have more control over how to deserialize the query arguments then use QueryArgumentsCborData or QueryArgumentsJsonString.

See also
QueryArgumentsCborData, QueryArgumentsJsonString

◆ QueryArgumentsCborData

byte [] DittoSDK.Sync.DittoSyncSubscription.QueryArgumentsCborData
get

Gets the query arguments of the sync subscription, encoded as CBOR.

See also
QueryArguments

◆ QueryArgumentsJsonString

string DittoSDK.Sync.DittoSyncSubscription.QueryArgumentsJsonString
get

Gets the query arguments of the sync subscription, encoded as a JSON string.

See also
QueryArguments