ctrlX Data Layer .NET API  4.3.0
Loading...
Searching...
No Matches
ISubscription Interface Reference

The ISubscription interface. More...

Inheritance diagram for ISubscription:
INativeDisposable

Public Member Functions

delegate void DataChangedEventHandler (ISubscription subscription, IDataChangedEventArgs args)
 The DataChanged event delegate.
 
DLR_RESULT Subscribe (string address)
 Subscribes to a node.
 
Task< ISubscriptionAsyncResultSubscribeAsync (string address)
 Subscribes to a node asynchronously.
 
DLR_RESULT SubscribeMulti (string[] addresses)
 Subscribes to a list of nodes.
 
Task< ISubscriptionAsyncResultSubscribeMultiAsync (string[] addresses)
 Subscribes to a list of nodes asynchronously.
 
DLR_RESULT Unsubscribe (string address)
 Unsubscribes the node.
 
DLR_RESULT UnsubscribeAll ()
 Unsubscribes all subscribed nodes.
 
Task< ISubscriptionAsyncResultUnsubscribeAllAsync ()
 Unsubscribes all subscribed nodes asynchronously.
 
Task< ISubscriptionAsyncResultUnsubscribeAsync (string address)
 Unsubscribes to a node asynchronously.
 
DLR_RESULT UnsubscribeMulti (string[] addresses)
 Unsubscribes to a list of nodes.
 
Task< ISubscriptionAsyncResultUnsubscribeMultiAsync (string[] addresses)
 Unsubscribes a list of nodes asynchronously.
 

Static Public Attributes

static readonly uint DefaultErrorIntervalMillis = 10000
 The default error interval in milli seconds.
 
static readonly uint DefaultKeepaliveIntervalMillis = 60000
 The default keep alive interval in milli seconds.
 
static readonly uint DefaultPublishIntervalMillis = 1000
 The default publish interval in milli seconds.
 
static readonly ulong DefaultSamplingIntervalMicros = 1000000
 The default sampling interval in micro seconds.
 

Properties

IClient Client [get]
 Gets the client.
 
string Id [get]
 Gets the subscription id.
 
object UserData [get]
 Gets the user data.
 
- Properties inherited from INativeDisposable
bool IsDisposed [get]
 Checks disposed.
 

Events

DataChangedEventHandler DataChanged
 Gets the DataChanged event.
 

Detailed Description

The ISubscription interface.

Definition at line 48 of file ISubscription.cs.

Member Function Documentation

◆ DataChangedEventHandler()

delegate void DataChangedEventHandler ( ISubscription  subscription,
IDataChangedEventArgs  args 
)

The DataChanged event delegate.

Parameters
subscriptionThe source subscription, which raises the event.
argsThe data changed event arguments.

◆ Subscribe()

DLR_RESULT Subscribe ( string  address)

Subscribes to a node.

Parameters
addressAddress of the subscription.
Returns
Result of the method call.
Exceptions
ObjectDisposedExceptionCannot access a disposed object.
ArgumentNullExceptionArgument cannot be null.

Example

var builder = new FlatBuffers.FlatBufferBuilder(Variant.DefaultFlatbuffersInitialSize);
var properties = comm.datalayer.SubscriptionProperties.CreateSubscriptionProperties(
builder: builder,
idOffset: builder.CreateString("mySubscription"),
keepaliveInterval: 10000,
publishInterval: 1000,
errorInterval: 10000);
builder.Finish(properties.Value);
var propertiesFlatbuffers = new Variant(builder);
// Create the Subscription
var(createResult, subscription) = client.CreateSubscription(propertiesFlatbuffers, userData: null);
const string cpuLoad = "framework/metrics/system/cpu-utilisation-percent";
var subscribeResult = subscription.Subscribe(address: cpuLoad);
Provides the implementation for IVariant.
Definition: Variant.cs:18
static readonly int DefaultFlatbuffersInitialSize
Gets the default Flatbuffers initial size in bytes.
Definition: Variant.cs:730

◆ SubscribeAsync()

Task< ISubscriptionAsyncResult > SubscribeAsync ( string  address)

Subscribes to a node asynchronously.

Parameters
addressAddress of the subscription.
Returns
Task.
Exceptions
ObjectDisposedExceptionCannot access a disposed object.
ArgumentNullExceptionArgument cannot be null.

◆ SubscribeMulti()

DLR_RESULT SubscribeMulti ( string[]  addresses)

Subscribes to a list of nodes.

Parameters
addressesAn array of the addresses.
Returns
Result of the method call.
Exceptions
ObjectDisposedExceptionCannot access a disposed object.
ArgumentNullExceptionArgument cannot be null.

◆ SubscribeMultiAsync()

Task< ISubscriptionAsyncResult > SubscribeMultiAsync ( string[]  addresses)

Subscribes to a list of nodes asynchronously.

Parameters
addressesAn array of the addresses.
Returns
Task.
Exceptions
ObjectDisposedExceptionCannot access a disposed object.
ArgumentNullExceptionArgument cannot be null.

◆ Unsubscribe()

DLR_RESULT Unsubscribe ( string  address)

Unsubscribes the node.

Parameters
addressAddress of the subscription.
Returns
Result of the method call.
Exceptions
ObjectDisposedExceptionCannot access a disposed object.
ArgumentNullExceptionArgument cannot be null.

◆ UnsubscribeAll()

DLR_RESULT UnsubscribeAll ( )

Unsubscribes all subscribed nodes.

Returns
Result of the method call.
Exceptions
ObjectDisposedExceptionCannot access a disposed object.

◆ UnsubscribeAllAsync()

Task< ISubscriptionAsyncResult > UnsubscribeAllAsync ( )

Unsubscribes all subscribed nodes asynchronously.

Returns
Task.
Exceptions
ObjectDisposedExceptionCannot access a disposed object.

◆ UnsubscribeAsync()

Task< ISubscriptionAsyncResult > UnsubscribeAsync ( string  address)

Unsubscribes to a node asynchronously.

Parameters
addressAddress of the subscription.
Returns
Result of the method call.
Exceptions
ObjectDisposedExceptionCannot access a disposed object.
ArgumentNullExceptionArgument cannot be null.

◆ UnsubscribeMulti()

DLR_RESULT UnsubscribeMulti ( string[]  addresses)

Unsubscribes to a list of nodes.

Parameters
addressesAn array of the addresses.
Returns
Result of the method call.
Exceptions
ObjectDisposedExceptionCannot access a disposed object.
ArgumentNullExceptionArgument cannot be null.

◆ UnsubscribeMultiAsync()

Task< ISubscriptionAsyncResult > UnsubscribeMultiAsync ( string[]  addresses)

Unsubscribes a list of nodes asynchronously.

Parameters
addressesAn array of the addresses.
Returns
Task.
Exceptions
ObjectDisposedExceptionCannot access a disposed object.
ArgumentNullExceptionArgument cannot be null.

Member Data Documentation

◆ DefaultErrorIntervalMillis

readonly uint DefaultErrorIntervalMillis = 10000
static

The default error interval in milli seconds.

Definition at line 67 of file ISubscription.cs.

◆ DefaultKeepaliveIntervalMillis

readonly uint DefaultKeepaliveIntervalMillis = 60000
static

The default keep alive interval in milli seconds.

Definition at line 57 of file ISubscription.cs.

◆ DefaultPublishIntervalMillis

readonly uint DefaultPublishIntervalMillis = 1000
static

The default publish interval in milli seconds.

Definition at line 62 of file ISubscription.cs.

◆ DefaultSamplingIntervalMicros

readonly ulong DefaultSamplingIntervalMicros = 1000000
static

The default sampling interval in micro seconds.

Definition at line 72 of file ISubscription.cs.

Property Documentation

◆ Client

IClient Client
get

Gets the client.

Definition at line 92 of file ISubscription.cs.

◆ Id

string Id
get

Gets the subscription id.

Definition at line 97 of file ISubscription.cs.

◆ UserData

object UserData
get

Gets the user data.

Definition at line 102 of file ISubscription.cs.

Event Documentation

◆ DataChanged

Gets the DataChanged event.

Definition at line 87 of file ISubscription.cs.


The documentation for this interface was generated from the following file: