class ResourceUpdateController {

    CompletableFuture<Void> onEventInternal(final String event, final String data) {
        if (!running.get()) {
            return CompletableFuture.completedFuture(null);
        }

        // Never do anything that could block in this callback!
        if (!Objects.equals(event, EventBus.Type.CHANGE_EVENT)) {
            return CompletableFuture.completedFuture(null);
        }

        final ChangeEvent changeEvent;
        try {
            changeEvent = JsonUtils.reader().forType(ChangeEvent.class).readValue(data);
        } catch (final IOException e) {
            LOGGER.error("Error while processing change-event {}", data, e);
            final CompletableFuture<Void> errored = new CompletableFuture<>();
            errored.completeExceptionally(e);

            return errored;
        }

        final CompletableFuture<Void> done = new CompletableFuture<>();
        if (changeEvent != null) {
            scheduler.execute(() -> run(changeEvent, done));
        }

        return done;
    }

    @Autowired public  ResourceUpdateController(final ResourceUpdateConfiguration configuration, final EventBus eventBus, final List<ResourceUpdateHandler> handlers);

}