当前位置: 首页>>代码示例>>Python>>正文


Python Observable.concat方法代码示例

本文整理汇总了Python中rx.core.Observable.concat方法的典型用法代码示例。如果您正苦于以下问题:Python Observable.concat方法的具体用法?Python Observable.concat怎么用?Python Observable.concat使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在rx.core.Observable的用法示例。


在下文中一共展示了Observable.concat方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: do_while

# 需要导入模块: from rx.core import Observable [as 别名]
# 或者: from rx.core.Observable import concat [as 别名]
def do_while(self, condition):
    """Repeats source as long as condition holds emulating a do while loop.

    Keyword arguments:
    condition -- {Function} The condition which determines if the source
        will be repeated.

    Returns an observable {Observable} sequence which is repeated as long
    as the condition holds.
    """

    return Observable.concat([self, Observable.while_do(condition, self)])
开发者ID:ESSL-CQQ,项目名称:RxPY,代码行数:14,代码来源:dowhile.py

示例2: repeat

# 需要导入模块: from rx.core import Observable [as 别名]
# 或者: from rx.core.Observable import concat [as 别名]
def repeat(self, repeat_count=None):
    """Repeats the observable sequence a specified number of times. If the
    repeat count is not specified, the sequence repeats indefinitely.

    1 - repeated = source.repeat()
    2 - repeated = source.repeat(42)

    Keyword arguments:
    repeat_count -- Number of times to repeat the sequence. If not
        provided, repeats the sequence indefinitely.

    Returns the observable sequence producing the elements of the given
    sequence repeatedly."""

    return Observable.concat(Enumerable.repeat(self, repeat_count))
开发者ID:ESSL-CQQ,项目名称:RxPY,代码行数:17,代码来源:repeat.py

示例3: while_do

# 需要导入模块: from rx.core import Observable [as 别名]
# 或者: from rx.core.Observable import concat [as 别名]
def while_do(cls, condition, source):
    """Repeats source as long as condition holds emulating a while loop.

    Keyword arguments:
    :param types.FunctionType condition: The condition which determines if the
        source will be repeated.
    :param Observable source: The observable sequence that will be run if the
        condition function returns true.

    :returns: An observable sequence which is repeated as long as the condition
        holds.
    :rtype: Observable
    """

    source = Observable.from_future(source)
    return Observable.concat(Enumerable.while_do(condition, source))
开发者ID:ESSL-CQQ,项目名称:RxPY,代码行数:18,代码来源:whiledo.py

示例4: concat

# 需要导入模块: from rx.core import Observable [as 别名]
# 或者: from rx.core.Observable import concat [as 别名]
def concat(self, *args):
    """Concatenates all the observable sequences. This takes in either an
    array or variable arguments to concatenate.

    1 - concatenated = xs.concat(ys, zs)
    2 - concatenated = xs.concat([ys, zs])

    Returns an observable sequence that contains the elements of each given
    sequence, in sequential order.
    """
    if isinstance(args[0], list):
        items = args[0]
    else:
        items = list(args)

    items.insert(0, self)
    return Observable.concat(items)
开发者ID:JohnWowUs,项目名称:RxPY,代码行数:19,代码来源:concat.py

示例5: start_with

# 需要导入模块: from rx.core import Observable [as 别名]
# 或者: from rx.core.Observable import concat [as 别名]
def start_with(self, *args, **kw):
    """Prepends a sequence of values to an observable sequence with an
    optional scheduler and an argument list of values to prepend.

    1 - source.start_with(1, 2, 3)
    2 - source.start_with(Scheduler.timeout, 1, 2, 3)

    Returns the source sequence prepended with the specified values.
    """

    if isinstance(args[0], Scheduler):
        scheduler = args[0]
        args = args[1:]
    else:
        scheduler = kw.get("scheduler", immediate_scheduler)

    sequence = [Observable.from_(args, scheduler), self]
    return Observable.concat(sequence)
开发者ID:ESSL-CQQ,项目名称:RxPY,代码行数:20,代码来源:startswith.py


注:本文中的rx.core.Observable.concat方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。