diff options
Diffstat (limited to 'product/service.infrastructure/threading/CommandProcessor.cs')
| -rw-r--r-- | product/service.infrastructure/threading/CommandProcessor.cs | 32 |
1 files changed, 4 insertions, 28 deletions
diff --git a/product/service.infrastructure/threading/CommandProcessor.cs b/product/service.infrastructure/threading/CommandProcessor.cs index 7c7b195..170ec4c 100644 --- a/product/service.infrastructure/threading/CommandProcessor.cs +++ b/product/service.infrastructure/threading/CommandProcessor.cs @@ -1,37 +1,13 @@ using System; -using System.Collections.Generic; using System.Linq.Expressions; using gorilla.commons.utility; namespace MoMoney.Service.Infrastructure.Threading { - public class CommandProcessor : ICommandProcessor + public interface CommandProcessor : Command { - readonly Queue<Command> queued_commands; - - public CommandProcessor() - { - queued_commands = new Queue<Command>(); - } - - public void add(Expression<Action> action_to_process) - { - add(new AnonymousCommand(action_to_process)); - } - - public void add(Command command_to_process) - { - queued_commands.Enqueue(command_to_process); - } - - public void run() - { - while (queued_commands.Count > 0) queued_commands.Dequeue().run(); - } - - public void stop() - { - queued_commands.Clear(); - } + void add(Expression<Action> action_to_process); + void add(Command command_to_process); + void stop(); } }
\ No newline at end of file |
