Skip to content

Add Flow.onStart, support emit in onCompletion #1348

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

Merged
merged 2 commits into from
Jul 17, 2019
Merged

Conversation

elizarov
Copy link
Contributor

@elizarov elizarov commented Jul 16, 2019

Add Flow.onStart, support emit in onCompletion

  • All "emitting" operators (onStart, transform, onCompletion) are moved
    to Emitters.kt and are implemented in a safe way, making sure that
    user-specified block is called on a SafeCollector only.
  • Unsafe internal version of transform (unsafeTransform) is introduced.
  • All transformations in Transform.kt are rewritten via unsafeTransform.
  • Added migration for startWith and concatWith.
  • Consistent docs for all migration functions.
  • JvmMultifileClass for Migration.kt so that renamed/deprecated
    functions (when they moved there) continue to resolve.

Fixes #1168

@elizarov elizarov requested a review from qwwdfsad July 16, 2019 23:02
@elizarov elizarov force-pushed the flow-transform-safety branch from a8e4da4 to 6610acc Compare July 17, 2019 02:29
@elizarov elizarov added the flow label Jul 17, 2019
@elizarov elizarov added this to the 1.3 milestone Jul 17, 2019
@elizarov elizarov force-pushed the flow-transform-safety branch from 6610acc to a77d713 Compare July 17, 2019 02:54
* All "emitting" operators (onStart, transform, onCompletion) are moved
  to Emitter
* All transformations in Transform.kt are rewritten via (unsafe)
  transforms, but all of
  (safe) transform, onStart and onCompletion operators collectors
  are safe.
* Added migration for startWith and concatWith.
* Consistent docs for all migration functions.
* JvmMultifileClass for Migration.kt so that renamed/deprecated
  functions (when they moved there) continue to resolve.

Fixes #1168
@elizarov elizarov force-pushed the flow-transform-safety branch from a77d713 to 5cf7796 Compare July 17, 2019 03:30
Copy link
Collaborator

@qwwdfsad qwwdfsad left a comment

Choose a reason for hiding this comment

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

Nice!

@qwwdfsad qwwdfsad merged commit 63b6e27 into develop Jul 17, 2019
@qwwdfsad qwwdfsad deleted the flow-transform-safety branch July 17, 2019 13:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants