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

Refactor WorkflowHost as a stream transformation #263

Closed
zach-klippenstein opened this issue Apr 11, 2019 · 2 comments
Closed

Refactor WorkflowHost as a stream transformation #263

zach-klippenstein opened this issue Apr 11, 2019 · 2 comments
Labels
enhancement New feature or request kotlin Affects the Kotlin library. points: 3
Milestone

Comments

@zach-klippenstein
Copy link
Collaborator

zach-klippenstein commented Apr 11, 2019

I am thinking about ultimately defining WorkflowHost as a stream transformation. E.g., using the new preview cold streams library (Kotlin/kotlinx.coroutines#254):

val inputs: Flow<WfInput>
val outputsAndRenderings: Flow<Pair<WfRendering, WfOutput?>> = inputs.flatMapWorkflow(myWorkflow)

It already has a stream of output events, but since we don't have a native kotlin (not to be confused with kotlin native) streams library yet, the host has to have its own lifetime and vend a hot channel. I'd like to turn that into a cold stream that only fires up the workflow universe when subscribed to, and tears it down when that subscription is disposed.

Issue #247 is a proposal for a stream of inputs. With that, WorkflowHost will have a transformer shape - stream in, stream out. So we can think of a workflow as a fancy way to write reactive operators declaratively.

Tagging this for post-v1.0 because Flow is still preview, so to do this properly we'd currently need to give the runtime direct dependencies on third-party Rx libraries which would be messy.

@zach-klippenstein
Copy link
Collaborator Author

@timdonnelly @davidapgar How would you feel about this on the Swift side?

@zach-klippenstein
Copy link
Collaborator Author

This was closed by #282.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request kotlin Affects the Kotlin library. points: 3
Projects
None yet
Development

No branches or pull requests

1 participant