mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-27 20:44:00 +02:00
Bind any collection to SignalR with a single call.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user