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

Internal cleanups #318

Merged
merged 1 commit into from
Apr 12, 2024
Merged

Internal cleanups #318

merged 1 commit into from
Apr 12, 2024

Conversation

JakeWharton
Copy link
Member

@JakeWharton JakeWharton commented Apr 11, 2024


  • CHANGELOG.md's "Unreleased" section has been updated, if applicable.

Comment on lines -216 to -218
val job = scope.launch(unconfined, start = UNDISPATCHED) {
channel = collectIntoChannel(this)
}
Copy link
Member Author

Choose a reason for hiding this comment

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

Now that tests aren't using collectIntoChannel, we can inline it and remove this pointless double launch.

Comment on lines -236 to -245
return object : Channel<T> by output {
override fun cancel(cause: CancellationException?) {
job.cancel()
output.close(cause)
}

override fun close(cause: Throwable?): Boolean {
job.cancel()
return output.close(cause)
}
Copy link
Member Author

Choose a reason for hiding this comment

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

This was wrapping to mix-in behavior only to be re-wrapped in ChannelTurbine. Meanwhile we pass in the job to ChannelTurbine, so just do all the work there.

Base automatically changed from jw.channel.2024-04-10 to trunk April 11, 2024 04:25
@JakeWharton JakeWharton enabled auto-merge (squash) April 12, 2024 14:27
@JakeWharton JakeWharton merged commit 0547b86 into trunk Apr 12, 2024
1 check passed
@JakeWharton JakeWharton deleted the jw.stuff.2024-04-10 branch April 12, 2024 14:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants