fix #947 and #1004 Add getContext() to Signal from materialize/doOnEach#1002
fix #947 and #1004 Add getContext() to Signal from materialize/doOnEach#1002simonbasle merged 2 commits intomasterfrom
Conversation
simonbasle
commented
Jan 3, 2018
- filled for doOnEach
- not filled for materialize for now
Codecov Report
@@ Coverage Diff @@
## master #1002 +/- ##
============================================
+ Coverage 83.59% 83.72% +0.13%
- Complexity 3388 3402 +14
============================================
Files 328 329 +1
Lines 26744 26763 +19
Branches 4930 4938 +8
============================================
+ Hits 22356 22408 +52
+ Misses 2893 2881 -12
+ Partials 1495 1474 -21
Continue to review full report at Codecov.
|
|
Use currentContext vs getContext - |
|
@simonbasle @smaldini In my custom implementation for this as shown in the github issue, not caching the context produced a not insignificant overhead. Unless it's particularly hard to cache this, I'd try to include that in this PR. |
c71e44c to
16e6fd2
Compare
|
@smaldini regarding the naming, I kept it consistent with other methods in |
|
|
||
| private static final long serialVersionUID = -2004454746525418508L; | ||
|
|
||
| private final Context context; |
There was a problem hiding this comment.
maybe transient, context is not serializable right now (should it?)
2116aaa to
41d6854
Compare
- filled for doOnEach - not filled for materialize for now - defaults to Context.empty() when not filled - use singleton if Signal.complete() built with empty Context
This commit adds the Context to Signals emitted by materialize. Additionally, both in materialize and in doOnEach the Context is cached, only fetched from `actual` upon subscriber construction. Additionally the ImmutableSignal Context is transient, since Context is not Serializable. Make Signal.context field transient (Context is not Serializable)
80a3735 to
276ff8a
Compare