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()); }
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()); }
public Task Unsubscribe(IHubObserver observer) { listeners.Unsubscribe(observer); return TaskDone.Done; }
public void Unsubscribe(IHubObserver observer) { _hubConnection.Remove(observer.MessageTag); }
public void Subscribe(IHubObserver observer) { _hubConnection.On <string>(observer.MessageTag, observer.HandleMessageAsync); }
public Task Unsubscribe(IHubObserver observer) { listeners.Unsubscribe(observer); return(TaskDone.Done); }