public async Task Subscribe(string channel) { await Groups.Add(Context.ConnectionId, channel); var ev = ChannelEvent.Subscribe(Context.ConnectionId, channel); await Publish(ev); }
public override Task OnDisconnected(bool stopCalled) { var ev = ChannelEvent.DisconnectedAdmin(Context.ConnectionId); Publish(ev); return(base.OnDisconnected(stopCalled)); }
public override Task OnConnected() { var ev = ChannelEvent.ConnectedAdmin(Context.ConnectionId); Publish(ev); return(base.OnConnected()); }
public Task Publish(ChannelEvent ev) { Clients.Group(ev.ChannelName).OnEvent(ev.Name, ev); return(Task.FromResult(0)); }