Bind any collection to SignalR with a single call.

This commit is contained in:
kay.one 2013-05-05 17:33:43 -07:00
commit a6aba16902
13 changed files with 106 additions and 26 deletions

View file

@ -1,5 +1,6 @@
using System.Threading.Tasks;
using Microsoft.AspNet.SignalR;
using Microsoft.AspNet.SignalR.Infrastructure;
using NLog;
using NzbDrone.Common.Messaging;
using NzbDrone.Core.Datastore;
@ -14,6 +15,7 @@ namespace NzbDrone.Api.SignalR
{
private readonly Logger _logger;
public BasicResourceConnection()
{
_logger = LogManager.GetCurrentClassLogger();
@ -33,7 +35,8 @@ namespace NzbDrone.Api.SignalR
public void HandleAsync(ModelEvent<T> message)
{
Connection.Broadcast(message);
var context =((ConnectionManager)GlobalHost.ConnectionManager).GetConnection(GetType());
context.Connection.Broadcast(message);
}
}
}