本文整理汇总了Python中rx.Observer方法的典型用法代码示例。如果您正苦于以下问题:Python rx.Observer方法的具体用法?Python rx.Observer怎么用?Python rx.Observer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类rx
的用法示例。
在下文中一共展示了rx.Observer方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: fake_extensionmethod
# 需要导入模块: import rx [as 别名]
# 或者: from rx import Observer [as 别名]
def fake_extensionmethod(self):
print('[custom-extensionmethod] Observer: {}'.format(self))
source = self
def subscribe(observer):
def on_next(x):
pass
return source.subscribe(
on_next, observer.on_error, observer.on_completed)
return AnonymousObservable(subscribe)
示例2: handle
# 需要导入模块: import rx [as 别名]
# 或者: from rx import Observer [as 别名]
def handle(self, tran_prop_req, scheduler=None):
"""Execute chaincode instantiation transaction proposal request.
:param tran_prop_req: chaincode instantiation transaction proposal request
:param scheduler: see rx.Scheduler, defaults to None
:return: An rx.Observer wrapper of chaincode instantiation response
"""
return _instantiate_chaincode(self._chain, tran_prop_req, scheduler)
示例3: handle
# 需要导入模块: import rx [as 别名]
# 或者: from rx import Observer [as 别名]
def handle(self, tran_prop_req, scheduler=None):
"""Execute chaincode invocation transaction proposal request.
:param scheduler: see rx.Scheduler (Default value = None)
:param tran_prop_req: chaincode invocation transaction proposal request
:return: An rx.Observer wrapper of chaincode invocation response
"""
return _invoke_chaincode(self._chain, tran_prop_req, scheduler)