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

Change typed whenTerminated sig to Future[Done], #25647 #26644

Merged
merged 1 commit into from
Apr 1, 2019

Conversation

patriknw
Copy link
Member

@patriknw patriknw commented Apr 1, 2019

Rebased #25651

Also changed terminate() to return Unit to not bias it towards the Scala API, completion can be observed with whenTerminated or getWhenTerminated

Refs #25647

@patriknw patriknw added the 2 - pick next Used to mark issues which are next up in the queue to be worked on. The tag is non-binding label Apr 1, 2019
@akka-ci akka-ci added validating PR is currently being validated by Jenkins tested PR that was successfully built and tested by Jenkins and removed validating PR is currently being validated by Jenkins labels Apr 1, 2019
@akka-ci
Copy link

akka-ci commented Apr 1, 2019

Test PASSed.

Copy link
Member

@johanandren johanandren left a comment

Choose a reason for hiding this comment

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

LGTM with one little nit

override def getWhenTerminated: CompletionStage[Terminated] = FutureConverters.toJava(whenTerminated)
private val terminationPromise = Promise[Done]
override def terminate(): Unit = terminationPromise.trySuccess(Done)
override def whenTerminated: Future[Done] = terminationPromise.future.map(_ => Done)(sameThreadExecutionContext)
Copy link
Member

Choose a reason for hiding this comment

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

No need to map if it is already a Future[Done]

Copy link
Member Author

Choose a reason for hiding this comment

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

Doh, thx

This change ignore the terminated passed from untyped and map it into Done,
with some minor changes for testing termination.

termiate() returns Unit to not bias it towards the Scala API, completion
can be observed with whenTerminated or getWhenTerminated
@akka-ci akka-ci added validating PR is currently being validated by Jenkins tested PR that was successfully built and tested by Jenkins and removed tested PR that was successfully built and tested by Jenkins validating PR is currently being validated by Jenkins labels Apr 1, 2019
@akka-ci
Copy link

akka-ci commented Apr 1, 2019

Test PASSed.

Copy link
Member

@chbatey chbatey left a comment

Choose a reason for hiding this comment

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

LGTM

@patriknw patriknw merged commit a023b15 into master Apr 1, 2019
@patriknw patriknw deleted the wip-whenTerminate-patriknw branch April 1, 2019 08:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2 - pick next Used to mark issues which are next up in the queue to be worked on. The tag is non-binding tested PR that was successfully built and tested by Jenkins
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants