Handle for an active subscription. Provides cancellation and status checking.
Usage
{:ok, sub} = KubeMQ.Client.subscribe_to_events(client, "my-channel", on_event: &handler/1)
true = KubeMQ.Subscription.active?(sub)
:ok = KubeMQ.Subscription.cancel(sub)
Summary
Functions
Check whether the subscription process is still alive.
Cancel an active subscription and stop its process.
Types
Functions
Check whether the subscription process is still alive.
Examples
true = KubeMQ.Subscription.active?(sub)
@spec cancel(t()) :: :ok
Cancel an active subscription and stop its process.
Demonitors the subscription process and stops it gracefully. Safe to call on already-stopped subscriptions.
Examples
{:ok, sub} = KubeMQ.Client.subscribe_to_events(client, "channel", on_event: &handler/1)
:ok = KubeMQ.Subscription.cancel(sub)