示例#1
0
        public WorkAgentConfiguration
        (
            WorkAgentSettings Settings,
            Action <IAppMessage> MessageReceiver,
            Action <W> DefaultWorker = null,
            IReadOnlyList <IWorkAgentObserver <W> > DefaultObservers = null,
            IReadOnlyList <IWorkSupplier <W> > DefaultSuppliers      = null

        )
        {
            this.Settings        = Settings;
            this.MessageReceiver = MessageReceiver;
            this.DefaultWorker   = DefaultWorker ?? (w => MessageReceiver(EmptyWorker()));
        }
 public WorkCommandAgentConfiguration
 (
     WorkAgentSettings Settings,
     Action <IAppMessage> MessageReceiver,
     Action <TSpec> DefaultWorker = null,
     IReadOnlyList <IWorkCommandAgentObserver <TSpec> > DefaultObservers = null,
     IReadOnlyList <IWorkCommandSupplier <TSpec> > DefaultSuppliers      = null
 ) : base
     (
         Settings,
         MessageReceiver,
         w => DefaultWorker?.Invoke(w.Command),
         DefaultObservers,
         DefaultSuppliers
     )
 {
 }
示例#3
0
        public WorkCommandAgentConfiguration <TSpec> Configure
        (
            WorkAgentSettings Settings,
            Action <IAppMessage> MessageReceiver,
            Action <TSpec> DefaultWorker = null,
            IReadOnlyList <IWorkCommandAgentObserver <TSpec> > DefaultObservers = null,
            IReadOnlyList <IWorkCommandSupplier <TSpec> > DefaultSuppliers      = null

        )
        => new WorkCommandAgentConfiguration <TSpec>
        (
            Settings,
            MessageReceiver,
            DefaultWorker,
            DefaultObservers,
            DefaultSuppliers
        );