mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-14 02:37:08 -07:00
Bind any collection to SignalR with a single call.
This commit is contained in:
parent
87a5dc7869
commit
a6aba16902
13 changed files with 106 additions and 26 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue