示例#1
0
文件: toasync.py 项目: ninmesara/RxPY
    def wrapper(*args):
        subject = AsyncSubject()

        def action(scheduler, state):
            try:
                result = func(*args)
            except Exception as ex:
                subject.on_error(ex)
                return

            subject.on_next(result)
            subject.on_completed()

        scheduler.schedule(action)
        return subject.as_observable()
示例#2
0
 def action1(scheduler, state=None):
     subject[0] = AsyncSubject()
示例#3
0
 def action1(scheduler, state=None):
     nonlocal subject
     subject = AsyncSubject()
示例#4
0
 def __init__(self, head):
     super(ChainObservable, self).__init__(self._subscribe)
     self.head = head
     self.tail = AsyncSubject()
示例#5
0
    def __init__(self, head):
        super().__init__()

        self.head = head
        self.tail = AsyncSubject()