use of tech.pegasys.teku.service.serviceutils.Service in project teku by ConsenSys.
the class ServiceController method doStart.
@Override
protected SafeFuture<?> doStart() {
final Iterator<Service> iterator = services.iterator();
SafeFuture<?> startupFuture = iterator.next().start();
while (iterator.hasNext()) {
final Service nextService = iterator.next();
startupFuture = startupFuture.thenCompose(__ -> nextService.start());
}
return startupFuture;
}
use of tech.pegasys.teku.service.serviceutils.Service in project teku by ConsenSys.
the class MetricsPublisherManager method doStart.
@Override
protected SafeFuture<?> doStart() {
if (metricsUrl.isEmpty()) {
return SafeFuture.COMPLETE;
}
AsyncRunner asyncRunner = asyncRunnerFactory.create("MetricPublisher", 1);
publisherTask = asyncRunner.runWithFixedDelay(this::publishMetrics, Duration.ofSeconds(intervalBetweenPublications), (err) -> LOG.error("Error while attempting to publish metrics to remote service", err));
return SafeFuture.COMPLETE;
}
Aggregations