本文整理匯總了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)