File: _forkjoin.py

package info (click to toggle)
python-rx 4.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,204 kB
  • sloc: python: 39,525; javascript: 77; makefile: 24
file content (28 lines) | stat: -rw-r--r-- 843 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
from typing import Any, Callable, Tuple

import reactivex
from reactivex import Observable


def fork_join_(
    *args: Observable[Any],
) -> Callable[[Observable[Any]], Observable[Tuple[Any, ...]]]:
    def fork_join(source: Observable[Any]) -> Observable[Tuple[Any, ...]]:
        """Wait for observables to complete and then combine last values
        they emitted into a tuple. Whenever any of that observables
        completes without emitting any value, result sequence will
        complete at that moment as well.

        Examples:
            >>> obs = fork_join(source)

        Returns:
            An observable sequence containing the result of combining
            last element from each source in given sequence.
        """
        return reactivex.fork_join(source, *args)

    return fork_join


__all__ = ["fork_join_"]