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

Create a Worker.transform operator. #533

Merged
merged 1 commit into from Aug 21, 2019

Conversation

@zach-klippenstein
Copy link
Collaborator

commented Aug 10, 2019

No description provided.

@zach-klippenstein zach-klippenstein added this to the kotlin v0.20.0 milestone Aug 10, 2019

@zach-klippenstein zach-klippenstein requested a review from rjrjr Aug 10, 2019

@zach-klippenstein zach-klippenstein added this to In progress in Workflow (Kotlin) via automation Aug 10, 2019

@rjrjr
rjrjr approved these changes Aug 12, 2019
/**
* Returns a [Worker] that finishes immediately without emitting anything.
*/
fun finished(): Worker<Nothing> = FinishedWorker

This comment has been minimized.

Copy link
@rjrjr

rjrjr Aug 12, 2019

Collaborator

Unused? Should at least be covered by a smoke test.

This comment has been minimized.

Copy link
@zach-klippenstein

zach-klippenstein Aug 13, 2019

Author Collaborator

Everything needs unit tests here.

This comment has been minimized.

Copy link
@zach-klippenstein

zach-klippenstein Aug 20, 2019

Author Collaborator

It's not unused, see GameWorkflow above, line 105.

I'm wondering if this should be a function though, or we should just expose it as a val. No need to do any casting here so no requirement to have it as a function.

This comment has been minimized.

Copy link
@rjrjr

rjrjr Aug 20, 2019

Collaborator

+1 to making it a val

This comment has been minimized.

Copy link
@zach-klippenstein

zach-klippenstein Aug 20, 2019

Author Collaborator

I'm going to keep it a function to be consistent with what Kotlin does: emptyFlow() is a function. I'm also going to give it a generic, so you can say Worker.finished<String>().

https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/empty-flow.html

@zach-klippenstein zach-klippenstein force-pushed the zachklipp/worker-transform branch from 8effd41 to 1db66e9 Aug 19, 2019

Workflow (Kotlin) automation moved this from In progress to Done Aug 19, 2019

Workflow (Kotlin) automation moved this from Done to In progress Aug 19, 2019

@zach-klippenstein zach-klippenstein changed the base branch from zachklipp/dungeon to master Aug 19, 2019

@zach-klippenstein zach-klippenstein force-pushed the zachklipp/worker-transform branch from 1db66e9 to dbe799c Aug 20, 2019

@rjrjr
rjrjr approved these changes Aug 20, 2019

@zach-klippenstein zach-klippenstein force-pushed the zachklipp/worker-transform branch 2 times, most recently from e979480 to 7496899 Aug 20, 2019

@zach-klippenstein zach-klippenstein force-pushed the zachklipp/worker-transform branch from 7496899 to b086f9a Aug 20, 2019

@zach-klippenstein

This comment has been minimized.

Copy link
Collaborator Author

commented Aug 20, 2019

Added unit tests.

@zach-klippenstein zach-klippenstein merged commit 1caf179 into master Aug 21, 2019

3 checks passed

Travis CI - Branch Build Passed
Details
Travis CI - Pull Request Build Passed
Details
license/cla Contributor License Agreement is signed.
Details

Workflow (Kotlin) automation moved this from In progress to Done Aug 21, 2019

@zach-klippenstein zach-klippenstein deleted the zachklipp/worker-transform branch Aug 21, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants
You can’t perform that action at this time.