* @brief Observable calls this method to pass disposable. Observer disposes this disposable WHEN observer wants to unsubscribe. * @note This method can be called multiple times. */
| 47 | * @note This method can be called multiple times. |
| 48 | */ |
| 49 | void set_upstream(const disposable_wrapper& d) noexcept |
| 50 | { |
| 51 | if (is_disposed()) |
| 52 | { |
| 53 | d.dispose(); |
| 54 | return; |
| 55 | } |
| 56 | |
| 57 | try |
| 58 | { |
| 59 | m_disposable.add(d); |
| 60 | m_strategy.set_upstream(d); |
| 61 | } |
| 62 | catch (...) |
| 63 | { |
| 64 | on_error(std::current_exception()); |
| 65 | } |
| 66 | } |
| 67 | |
| 68 | /** |
| 69 | * @brief Observable calls this method to check if observer interested or not in emissions |