using MediaBrowser.Controller;
using MediaBrowser.Controller.Net;
using MediaBrowser.Model.Logging;
using MediaBrowser.Model.System;
using System.Threading.Tasks;
using MediaBrowser.Model.Threading;
using System.Threading;
namespace MediaBrowser.Api.System
{
///
/// Class SystemInfoWebSocketListener
///
public class SystemInfoWebSocketListener : BasePeriodicWebSocketListener
{
///
/// Gets the name.
///
/// The name.
protected override string Name
{
get { return "SystemInfo"; }
}
///
/// The _kernel
///
private readonly IServerApplicationHost _appHost;
///
/// Initializes a new instance of the class.
///
public SystemInfoWebSocketListener(ILogger logger, IServerApplicationHost appHost, ITimerFactory timerFactory)
: base(logger, timerFactory)
{
_appHost = appHost;
}
///
/// Gets the data to send.
///
/// The state.
/// Task{SystemInfo}.
protected override Task GetDataToSend(WebSocketListenerState state, CancellationToken cancellationToken)
{
return _appHost.GetSystemInfo(cancellationToken);
}
}
}