Beispiel #1
0
        // TODO: publish, unsubscribe, subscribe, history, presence, presense_stats

        #region Disposable support

        /// <summary>
        /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
        /// </summary>
        public void Dispose()
        {
            PublishEventSource?.OnCompleted();
            PublishEventSource?.Dispose();

            JoinEventSource?.OnCompleted();
            JoinEventSource?.Dispose();

            LeaveEventSource?.OnCompleted();
            LeaveEventSource?.Dispose();

            SubscribedEventSource?.OnCompleted();
            SubscribedEventSource?.Dispose();

            UnsubscribedEventSource?.OnCompleted();
            UnsubscribedEventSource?.Dispose();

            SubscriptionErrorEventSource?.OnCompleted();
            SubscriptionErrorEventSource?.Dispose();
        }
Beispiel #2
0
 public void OnLeave(Func <LeaveEvent, Task> leaveEventHandler)
 {
     LeaveEventSource ??= new Subject <LeaveEvent>();
     LeaveEventSource.SubscribeAsync(leaveEventHandler);
 }
Beispiel #3
0
 public void OnLeave(Action <LeaveEvent> leaveEventHandler)
 {
     LeaveEventSource ??= new Subject <LeaveEvent>();
     LeaveEventSource.Subscribe(leaveEventHandler);
 }