UnsubscribeAsync

Removes a subscription.

Arguments

Copied to clipboard!
public async Task UnsubscribeAsync(string roomId);
Argument Type Description
room_id
string&
Subscription room ID

Exceptions

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

Usage

Copied to clipboard!
NotificationHandler listener = (notification) => {};

try {
  string room_id = await kuzzle.Realtime.SubscribeAsync(
    "nyc-open-data",
    "yellow-taxi",
    new JObject(),
    listener);

  await kuzzle.Realtime.UnsubscribeAsync(room_id);

  Console.WriteLine("Successfully unsubscribed");
} catch (KuzzleException e) {
  Console.WriteLine(e);
}