Ejemplo n.º 1
0
    def __post_init__(self):
        self.lock = threading.RLock()

        self.observer = None

        # state once observed
        self.termination_state = RawTerminationStates.InitState()
        self.state = RawControlledZipStates.WaitOnLeftRight()
Ejemplo n.º 2
0
    def __post_init__(self):
        # create two selector observablesubjects used to match Flowables
        self.left_selector = PublishObservableSubject()
        self.right_selector = PublishObservableSubject()

        self.lock = threading.RLock()

        self.observer = None

        # state once observed
        self.termination_state = RawTerminationStates.InitState()
        self.state = RawControlledZipStates.WaitOnLeftRight()
Ejemplo n.º 3
0
    def __init__(
        self,
        left: Observable,
        right: Observable,
    ):
        """
        :param left: Flowable whose elements get merged
        :param right: other Flowable whose elements get merged
        """

        self.left = left
        self.right = right

        # MergeObservable states
        self.observer = None
        self.termination_state = RawTerminationStates.InitState()
        self.state = RawMergeStates.NoneReceived()

        self.lock = threading.RLock()
    def __init__(
        self,
        left: Observable,
        right: Observable,
    ):
        """
        :param left: lef observable
        :param right: right observable
        :param is_lower: if right is lower than left, request next right
        :param is_higher: if right is higher than left, request next left
        """

        # save input arguments
        self.left_observable = left
        self.right_observable = right

        self.lock = threading.RLock()

        self.observer = None

        # state once observed
        self.termination_state = RawTerminationStates.InitState()
        self.state = RawControlledZipStates.WaitOnLeftRight()
Ejemplo n.º 5
0
    def __init__(
        self,
        left: Observable,
        right: Observable,
        stack: List[FrameSummary],
    ):
        """
        :param left: left observable
        :param right: right observable
        :param selector: a result selector function that maps each zipped element to some result
        """

        super().__init__()

        self.left = left
        self.right = right
        self.stack = stack

        self.lock = threading.RLock()

        # Zip2Observable states
        self.observer: Optional[Observer] = None
        self.termination_state = RawTerminationStates.InitState()
        self.state: RawZipStates.ZipState = RawZipStates.WaitOnLeftRight()
Ejemplo n.º 6
0
    def _on_completed_right(self):
        termination_state = RawTerminationStates.RightCompletedState()

        self._on_error_or_complete(next_termination_state=termination_state)
Ejemplo n.º 7
0
    def _on_error(self, exc: Exception):
        termination_state = RawTerminationStates.ErrorState(exc)

        self._on_error_or_complete(next_termination_state=termination_state,
                                   exc=exc)
 def _on_completed_right(self):
     next_final_state = RawTerminationStates.RightCompletedState()
     self._on_error_or_complete(next_final_state=next_final_state, )
 def _on_completed_left(self):
     next_final_state = RawTerminationStates.LeftCompletedState()
     self._on_error_or_complete(next_final_state=next_final_state)
 def _on_error(self, exc):
     next_final_state = RawTerminationStates.ErrorState(exc=exc, )
     self._on_error_or_complete(
         next_final_state=next_final_state,
         exc=exc,
     )