Exemple #1
0
        public static void Initialize()
        {
            clients = GlobalHost.ConnectionManager.GetHubContext <Relay>().Clients;

            client = new HubClient();
            proxy  = Task.Run(() => HubObserverFactory.CreateObjectReference(client)).Result;

            Task.Run(() => Subscribe())
            .Wait();

            Task.Run(() => Resubscribe());
        }
Exemple #2
0
        public static void Initialize()
        {
            clients = GlobalHost.ConnectionManager.GetHubContext<Relay>().Clients;

            client = new HubClient();
            proxy  = Task.Run(()=> HubObserverFactory.CreateObjectReference(client)).Result;

            Task.Run(() => Subscribe())
                .Wait();

            Task.Run(() => Resubscribe());
        }
Exemple #3
0
 public Task Unsubscribe(IHubObserver observer)
 {
     listeners.Unsubscribe(observer);
     return TaskDone.Done;
 }
Exemple #4
0
 public void Unsubscribe(IHubObserver observer)
 {
     _hubConnection.Remove(observer.MessageTag);
 }
Exemple #5
0
 public void Subscribe(IHubObserver observer)
 {
     _hubConnection.On <string>(observer.MessageTag, observer.HandleMessageAsync);
 }
Exemple #6
0
 public Task Unsubscribe(IHubObserver observer)
 {
     listeners.Unsubscribe(observer);
     return(TaskDone.Done);
 }