Пример #1
0
 public BaseMessageHandler(IWorkPolicy policy, IAuditService auditService, ILogger logger) {
     WorkPolicy = policy;
     AuditService = auditService;
     Logger = logger;
     PolicyHandlers = new List<Tuple<Func<IWorkPolicyConclusion, bool>, Action<IProcessableUnit, PolicyResultHandler>>> {
         Tuple.Create<PRCHOICE, PREXEC>(pc => pc.Completed, (u, h) => h.Completed(u)),
         Tuple.Create<PRCHOICE, PREXEC>(pc => pc.Discard, (u, h) => h.Discard(u)),
         Tuple.Create<PRCHOICE, PREXEC>(pc => pc.Retry, (u, h) => h.Retry(u)),
         Tuple.Create<PRCHOICE, PREXEC>(pc => pc.PassToFailureHandling, (u, h) => h.ActivateFailureHandling(u)), 
         Tuple.Create<PRCHOICE, PREXEC>(pc => pc.Block, (u, h) => h.Block(u)) 
     };
     //Blocked = false;
 }
Пример #2
0
 public BaseMessageHandler(IWorkPolicy policy, IAuditService auditService, ILogger logger)
 {
     WorkPolicy     = policy;
     AuditService   = auditService;
     Logger         = logger;
     PolicyHandlers = new List <Tuple <Func <IWorkPolicyConclusion, bool>, Action <IProcessableUnit, PolicyResultHandler> > > {
         Tuple.Create <PRCHOICE, PREXEC>(pc => pc.Completed, (u, h) => h.Completed(u)),
         Tuple.Create <PRCHOICE, PREXEC>(pc => pc.Discard, (u, h) => h.Discard(u)),
         Tuple.Create <PRCHOICE, PREXEC>(pc => pc.Retry, (u, h) => h.Retry(u)),
         Tuple.Create <PRCHOICE, PREXEC>(pc => pc.PassToFailureHandling, (u, h) => h.ActivateFailureHandling(u)),
         Tuple.Create <PRCHOICE, PREXEC>(pc => pc.Block, (u, h) => h.Block(u))
     };
     //Blocked = false;
 }
 public ResourceLimitingMessageHandler(IWorkPolicy policy, IAuditService auditService, ILogger logger) : base(policy, auditService, logger)
 {
 }
 public InMemoryMessageHandler(IWorkPolicy policy, IAuditService auditService, ILogger logger)
     : base(policy, auditService, logger)
 {
     Pending = new ConcurrentQueue<IProcessableUnit>();
 }
Пример #5
0
 public InMemoryMessageHandler(IWorkPolicy policy, IAuditService auditService, ILogger logger) : base(policy, auditService, logger)
 {
     Pending = new ConcurrentQueue <IProcessableUnit>();
 }
 public ResourceLimitingMessageHandler(IWorkPolicy policy, IAuditService auditService, ILogger logger)
     : base(policy, auditService, logger)
 {
 }