mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-20 13:33:34 -07:00
split MessageAggregator in EventAggregator and CommandExecutor
This commit is contained in:
parent
909439f615
commit
64181ebdff
83 changed files with 296 additions and 233 deletions
|
@ -10,11 +10,11 @@ namespace NzbDrone.Api
|
|||
where TResource : RestResource, new()
|
||||
where TModel : ModelBase
|
||||
{
|
||||
private readonly IMessageAggregator _messageAggregator;
|
||||
private readonly ICommandExecutor _commandExecutor;
|
||||
|
||||
protected NzbDroneRestModuleWithSignalR(IMessageAggregator messageAggregator)
|
||||
protected NzbDroneRestModuleWithSignalR(ICommandExecutor commandExecutor)
|
||||
{
|
||||
_messageAggregator = messageAggregator;
|
||||
_commandExecutor = commandExecutor;
|
||||
}
|
||||
|
||||
public void Handle(ModelEvent<TModel> message)
|
||||
|
@ -37,7 +37,7 @@ namespace NzbDrone.Api
|
|||
Body = new ResourceChangeMessage<TResource>(resource, action)
|
||||
};
|
||||
|
||||
_messageAggregator.PublishCommand(new BroadcastSignalRMessage(signalRMessage));
|
||||
_commandExecutor.PublishCommand(new BroadcastSignalRMessage(signalRMessage));
|
||||
}
|
||||
|
||||
protected void BroadcastResourceChange(ModelAction action)
|
||||
|
@ -48,7 +48,7 @@ namespace NzbDrone.Api
|
|||
Body = new ResourceChangeMessage<TResource>(action)
|
||||
};
|
||||
|
||||
_messageAggregator.PublishCommand(new BroadcastSignalRMessage(signalRMessage));
|
||||
_commandExecutor.PublishCommand(new BroadcastSignalRMessage(signalRMessage));
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue