Philosophical question: is `shareIn` an intermedia...
# coroutines
s
Philosophical question: is
shareIn
an intermediate operator, or a terminal operator? Both? Neither?
🦖 1
r
I'd say both, depends on
started
Eagerly, terminal, doesn't matter what the downstream does WhileSubscribed, not, upstream behaviour is affected by the downstream
Lazily, a mix of both 🙂
s
Makes sense, I like the idea of basing the decision on whether it can be affected by downstream terminal operators
And yet, errors from the upstream will always be handled by the sharing coroutine, never by the downstream. That's an argument for calling it a terminal. To be honest, I think the answer to this particular question is probably just undefined 😄
🤔 I suppose
catch
also has the same error-trapping properties, and that's intermediate. So maybe I'm changing my own mind there.
r
Yeah I was going to say 🙂 you could do the equivalent with catch and onComplete