private static <T> Runnable createPublisherRunnable(final Project project, final Topic<? extends T> topic, final Consumer<? super T> listener) {
    return () -> {
      if (project.isDisposed()) {
        throw new ProcessCanceledException();
      }
      listener.consume(project.getMessageBus().syncPublisher(topic));
    };
  }
private static <T> Runnable createPublisherRunnable(final Project project, final Topic<? extends T> topic, final Consumer<? super T> listener)