public static <T> void invokeLaterIfNeededOnSyncPublisher(final Project project, final Topic<? extends T> topic, final Consumer<? super T> listener) {
    final Application application = ApplicationManager.getApplication();
    final Runnable runnable = createPublisherRunnable(project, topic, listener);
    if (application.isDispatchThread()) {
      runnable.run();
    }
    else {
      application.invokeLater(runnable);
    }
  }
public static <T> void invokeLaterIfNeededOnSyncPublisher(final Project project, final Topic<? extends T> topic, final Consumer<? super T> listener)