Пример #1
0
 public void Start()
 {
     _subscriptions.Clear();
     _workerThreadId = _subscriptions.WorkerPool.StartDedicatedWorker().ThreadId;
     _subscriptions.Listen <DataRequest <StitchInstance>, DataResponse <StitchInstance> >(l => l
                                                                                          .WithDefaultTopic()
                                                                                          .Invoke(_service.HandleRequest)
                                                                                          .OnThread(_workerThreadId));
     _subscriptions.Listen <DataRequest <NodeStatus>, DataResponse <NodeStatus> >(l => l
                                                                                  .WithDefaultTopic()
                                                                                  .Invoke(_service.HandleRequest)
                                                                                  .OnThread(_workerThreadId));
     _subscriptions.Listen <DataRequest <CommandJob>, DataResponse <CommandJob> >(l => l
                                                                                  .WithDefaultTopic()
                                                                                  .Invoke(_service.HandleRequest)
                                                                                  .OnThread(_workerThreadId));
     _subscriptions.Listen <DataRequest <PackageFile>, DataResponse <PackageFile> >(l => l
                                                                                    .WithDefaultTopic()
                                                                                    .Invoke(_service.HandleRequest)
                                                                                    .OnThread(_workerThreadId));
 }
Пример #2
0
        public void Start()
        {
            _subscriptions.Clear();
            _threadId = _subscriptions.WorkerPool.StartDedicatedWorker().ThreadId;
            _subscriptions.Subscribe <LogEvent>(b => b
                                                .WithTopic(LogEvent.LevelDebug)
                                                .Invoke(LogDebug)
                                                .OnThread(_threadId));

            _subscriptions.Subscribe <LogEvent>(b => b
                                                .WithTopic(LogEvent.LevelInformation)
                                                .Invoke(LogInformation)
                                                .OnThread(_threadId));

            _subscriptions.Subscribe <LogEvent>(b => b
                                                .WithTopic(LogEvent.LevelWarning)
                                                .Invoke(LogWarning)
                                                .OnThread(_threadId));

            _subscriptions.Subscribe <LogEvent>(b => b
                                                .WithTopic(LogEvent.LevelError)
                                                .Invoke(LogError)
                                                .OnThread(_threadId));
        }