@NotNull public static <R extends P4CommandRunner.ServerResult> P4CommandRunner.FutureResult<R> syncQuery(@NotNull Project project, @NotNull ServerConfig config, @NotNull P4CommandRunner.SyncServerQuery<R> query) { final Pair<P4ServerComponent, Boolean> instance = findInstance(project); P4CommandRunner.FutureResult<R> ret = instance.first.getCommandRunner().syncQuery(config, query); if (instance.second) { ret.getPromise().whenAnyState(instance.first::dispose); } return ret; }
@NotNull public static <R extends P4CommandRunner.ClientResult> P4CommandRunner.FutureResult<R> syncQuery(@NotNull Project project, @NotNull ClientConfig config, @NotNull P4CommandRunner.SyncClientQuery<R> query) { final Pair<P4ServerComponent, Boolean> instance = findInstance(project); P4CommandRunner.FutureResult<R> ret = instance.first.getCommandRunner().syncQuery(config, query); if (instance.second) { ret.getPromise().whenAnyState(instance.first::dispose); } return ret; }