jellyfin/MediaBrowser.Common/Api/SystemInfoWebSocketListener.cs

45 lines
1.3 KiB
C#
Raw Normal View History

2013-02-21 01:33:05 +00:00
using MediaBrowser.Common.Kernel;
2013-02-21 20:26:35 +00:00
using MediaBrowser.Model.Logging;
2013-02-21 01:33:05 +00:00
using System.ComponentModel.Composition;
using System.Threading.Tasks;
namespace MediaBrowser.Common.Api
{
/// <summary>
/// Class SystemInfoWebSocketListener
/// </summary>
[Export(typeof(IWebSocketListener))]
public class SystemInfoWebSocketListener : BasePeriodicWebSocketListener<IKernel, Model.System.SystemInfo, object>
{
/// <summary>
/// Gets the name.
/// </summary>
/// <value>The name.</value>
protected override string Name
{
get { return "SystemInfo"; }
}
2013-02-21 20:26:35 +00:00
/// <summary>
/// Initializes a new instance of the <see cref="SystemInfoWebSocketListener" /> class.
/// </summary>
/// <param name="logger">The logger.</param>
[ImportingConstructor]
public SystemInfoWebSocketListener([Import("logger")] ILogger logger)
: base(logger)
{
}
2013-02-21 01:33:05 +00:00
/// <summary>
/// Gets the data to send.
/// </summary>
/// <param name="state">The state.</param>
/// <returns>Task{SystemInfo}.</returns>
protected override Task<Model.System.SystemInfo> GetDataToSend(object state)
{
return Task.FromResult(Kernel.GetSystemInfo());
}
}
}