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

Lint suppressions and use custom observers in lifecycle subscriptions #108

Merged
merged 4 commits into from
Oct 16, 2017

Conversation

ZacSweers
Copy link
Collaborator

@ZacSweers ZacSweers commented Oct 15, 2017

This does a couple opportunistic cleanups:

  • Adds some lint suppressions regarding the recent synthetic accessor changes
  • Create full disposable observers with documented no-op completions. This gives us two things:
    • A minor perf improvement by less objects by creating one single observer rather than two consumers + LambdaObserver and the inner bits of doOnEvent (three-ish allocs). This saves about 5 allocations per subscribe in total. Relates to Measuring runtime performance #105
    • Closes API Change Discussion: Switch to Single instead of Maybe #101. After thinking on it quite a bit, I think Maybe makes sense. There are some cases where the lifecycle is deferred and may resolve to be "unbound". I've also added an unbound() factory to TestScopeProvider to mimic this.

This changes the lifecycle subscriptions to use full observers to save some allocations, and also documents the noop on completions
@ZacSweers ZacSweers merged commit 5e00b57 into master Oct 16, 2017
@ZacSweers ZacSweers deleted the z/improveCompletion branch October 16, 2017 22:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

API Change Discussion: Switch to Single instead of Maybe
2 participants