Closed
Description
While looking for emissions after terminal events I was looking at OperatorDoEach
which is called by doOnNext
, doOnError
, doOnCompleted
, and doOnEach
of course. I noticed these things:
- lots of wasted allocations per call (use of
ActionSubscriber
when all that is needed is anActionObserver
) and passing three actions toOperatorDoEach
when for three of the four operators we only need one action. - it doesn't call
RxJavaHooks.error
for secondary error emissions from upstream - it does call
Exceptions.throwIfFatal
for all error emissions (do we want to do this generally? I haven't seen it much outside error catching on externally supplied functions or actions)
I'd quite like to see doOnNext
and doOnError
in particular more efficient because I use them a lot. Should I create dedicated Operator/OnSubscribe classes for the single action operators or perhaps one shared one that has an extra parameter (to indicate what notification type is being used)?
Metadata
Metadata
Assignees
Labels
No labels