Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow reflective bloop invocation with cancellation #685

Merged
merged 1 commit into from
Oct 18, 2018

Conversation

jvican
Copy link
Contributor

@jvican jvican commented Oct 18, 2018

  1. Add a reflectMain method that exposes a Java-only API to run
    Bloop's CLI (usually for executing a long-running process like bloop bsp).
  2. Add support for cancellation. Whenever the user feels like quitting,
    it can complete the cancel: CompletableFuture[Boolean] with a true
    to force the cancellation. If it completes it with a false, the
    cancellation will not happen.

@jvican jvican requested a review from olafurpg October 18, 2018 09:54
@jvican jvican added the build server Any issue or pull request that has to do with hot compilers or BSP. label Oct 18, 2018
Copy link
Contributor

@olafurpg olafurpg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One minor comment, otherwise looks great. Thanks!

out: PrintStream,
err: PrintStream,
props: java.util.Properties,
cancel: CompletableFuture[Boolean]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we make this java.lang.Boolean?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Boxed scala.Boolean has a different signature

target git:(bsp) ✗ scalac foo.scala && javap a$  // with List[scala.Boolean]
Compiled from "foo.scala"
public final class a$ {
  public static a$ MODULE$;
  public static {};
  public void b(scala.collection.immutable.List<java.lang.Object>);
}
➜  target git:(bsp) ✗ scalac foo.scala && javap a$ // with List[java.lang.Boolean]
Compiled from "foo.scala"
public final class a$ {
  public static a$ MODULE$;
  public static {};
  public void b(scala.collection.immutable.List<java.lang.Boolean>);

1. Add a `reflectMain` method that exposes a Java-only API to run
   Bloop's CLI (usually for executing a long-running process like `bloop
   bsp`).
2. Add support for cancellation. Whenever the user feels like quitting,
   it can complete the `cancel: CompletableFuture[Boolean]` with a `true`
   to force the cancellation. If it completes it with a `false`, the
   cancellation will not happen.
@jvican jvican force-pushed the topic/reflective-main branch from 8751ecd to ed7b7a5 Compare October 18, 2018 11:07
@jvican
Copy link
Contributor Author

jvican commented Oct 18, 2018

Thanks for the catch, let's get this change ready in a release.

@jvican jvican merged commit cfb820e into master Oct 18, 2018
@olafurpg olafurpg deleted the topic/reflective-main branch October 18, 2018 12:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build server Any issue or pull request that has to do with hot compilers or BSP.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants