public RoutedProducer<ExecuteCheck, WorkerKey> publishChecks() { return this.publishChecks(null); }
public RoutedProducer<ResultMO, ResultKey> publishResults() { return this.publishResults(null); }
public Consumer<ExecuteCheck, WorkerKey> consumeChecks(DeliveryHandler<ExecuteCheck> handler, UUID site, String workerPool, String engine) { return this.consumeChecks(handler, site, workerPool, engine, false, null); }
this.workerQueue = WorkerQueue.open(); this.resultConsumers.add(this.workerQueue.consumeResults((r) -> { logger.trace("Processing pooled/site result"); processExecuted(r); }, this.instanceId.toString())); this.fallbackConsumers.add(this.workerQueue.consumeFallbackResults((r) -> { logger.debug("Processing fallback result"); processExecuted(r); })); this.deadConsumers.add(this.workerQueue.consumeDeadChecks((e) -> { processDead(e); })); this.deadAgentConsumers.add(this.workerQueue.consumeDeadAgentChecks((e) -> { processDeadAgent(e); }));
protected void startQueues() throws Exception { this.workerQueue = WorkerQueue.open(); this.executeCheckProducer = this.workerQueue.publishChecks(); this.schedulerQueue = SchedulerQueue.open(); // TODO scheduler names this.schedulerActionConsumer = this.schedulerQueue.consumeSchedulerActions((a) -> { executeAction(a); }); }
@Override public void start() { // setup the consumer logger.info("Creating readings consumer"); this.workerQueue = WorkerQueue.open(); // create the consumers for (int i = 0; i < this.getThreads(); i++) { // consume results, currently for all sites this.readingConsumers.add(this.workerQueue.consumeReadings((r) -> { logger.trace("Processing pooled/site readings"); processReadings(r); }, this.instanceId.toString())); // consume results, currently for all sites this.fallbackConsumers.add(this.workerQueue.consumeFallbackReadings((r) -> { logger.debug("Processing fallback readings"); processReadings(r); })); } } }
@Override public void start() throws Exception { // open the queue this.controlQueue = ControlQueue.open(); this.watcherQueue = WatcherQueue.open(); this.workerQueue = WorkerQueue.open(); // control this.controlEventProducer = this.controlQueue.publishControlEvents(); // watcher this.watcherEventConsumer = this.watcherQueue.consumeWatcherEvents(this, this.getWatcher().getId(), this.getName()); // results this.resultProducer = this.workerQueue.publishResults(); // start the executors for (Executor<?> ex : this.getExecutors()) { ex.start(); } // register with the controller this.controlEventProducer.publish(new RegisterWatcher(this.getWatcher().getId(), this.getName(), this.getWatcher().getSite(), this.getWatcher().getLocation())); }
protected void shutdownQueues() { this.schedulerActionConsumer.close(); this.schedulerQueue.close(); this.executeCheckProducer.close(); this.workerQueue.close(); }