SDK
SDK C# v1.x
1

You are currently looking at the documentation of a previous version of Kuzzle. We strongly recommend that you use the latest version. You can also use the version selector in the top menu.

CountAsync #

Returns the number of other connections sharing the same subscription.

Arguments #

Copied to clipboard!
public async Task<int> CountAsync(string roomId);
Argument Type Description
room_id
string
Subscription room ID

Return #

Returns the number of active connections using the same provided subscription room.

Exceptions #

Throws a KuzzleException if there is an error. See how to handle error.

Usage #

Copied to clipboard!
NotificationHandler listener = (response) => {};
try {
  string room_id = await kuzzle.Realtime.SubscribeAsync(
    "nyc-open-data",
    "yellow-taxi",
    JObject.Parse("{}"),
    listener);
  int count = await kuzzle.Realtime.CountAsync(room_id);
  Console.WriteLine($"Currently {count} active subscriptions");
} catch (KuzzleException e) {
  Console.WriteLine(e);
}