public UpdateClientStateWorker(IHubContext <MediaControlHub> hub, MediaClientStorage storage) { _storage = storage; _hub = hub; Task.Run(async() => { while (true) { _storage.Clients.Clear(); await _hub.Clients.All.SendAsync(MessagingConstants.ClientMessages.CHECK_STATE); await Task.Delay(5000); } }); }
public MediaControlHub(MediaClientStorage storage) { _storage = storage; }
public MediaController(IHubContext <MediaControlHub> hubContext, MediaClientStorage storage, UpdateClientStateWorker worker) { _hubContext = hubContext; _storage = storage; }