split MessageAggregator in EventAggregator and CommandExecutor

This commit is contained in:
kay.one 2013-09-13 23:36:07 -07:00
commit 64181ebdff
83 changed files with 296 additions and 233 deletions

View file

@ -16,14 +16,14 @@ namespace NzbDrone.Api.Commands
{
public class CommandModule : NzbDroneRestModuleWithSignalR<CommandResource, Command>, IHandle<CommandUpdatedEvent>
{
private readonly IMessageAggregator _messageAggregator;
private readonly ICommandExecutor _commandExecutor;
private readonly IContainer _container;
private readonly ITrackCommands _trackCommands;
public CommandModule(IMessageAggregator messageAggregator, IContainer container, ITrackCommands trackCommands)
: base(messageAggregator)
public CommandModule(ICommandExecutor commandExecutor, IContainer container, ITrackCommands trackCommands)
: base(commandExecutor)
{
_messageAggregator = messageAggregator;
_commandExecutor = commandExecutor;
_container = container;
_trackCommands = trackCommands;
@ -48,7 +48,7 @@ namespace NzbDrone.Api.Commands
dynamic command = Request.Body.FromJson(commandType);
var trackedCommand = (Command)_messageAggregator.PublishCommandAsync(command);
var trackedCommand = (Command)_commandExecutor.PublishCommandAsync(command);
return trackedCommand.Id;
}