1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-12-16 11:37:58 +02:00
Sonarr/NzbDrone.SignalR/NzbDronePersistentConnection.cs

24 lines
659 B
C#

using Microsoft.AspNet.SignalR;
using Microsoft.AspNet.SignalR.Infrastructure;
using NzbDrone.Core.Messaging;
using NzbDrone.Core.Messaging.Commands;
namespace NzbDrone.SignalR
{
public sealed class NzbDronePersistentConnection : PersistentConnection, IExecute<BroadcastSignalRMessage>
{
private IPersistentConnectionContext Context
{
get
{
return ((ConnectionManager)GlobalHost.ConnectionManager).GetConnection(GetType());
}
}
public void Execute(BroadcastSignalRMessage message)
{
Context.Connection.Broadcast(message.Body);
}
}
}