本文整理汇总了Python中pykka.registry.ActorRegistry.get_by_urn方法的典型用法代码示例。如果您正苦于以下问题:Python ActorRegistry.get_by_urn方法的具体用法?Python ActorRegistry.get_by_urn怎么用?Python ActorRegistry.get_by_urn使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pykka.registry.ActorRegistry
的用法示例。
在下文中一共展示了ActorRegistry.get_by_urn方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: is_alive
# 需要导入模块: from pykka.registry import ActorRegistry [as 别名]
# 或者: from pykka.registry.ActorRegistry import get_by_urn [as 别名]
def is_alive(self):
"""
Check if actor is alive.
This is based on whether the actor is registered in the actor registry
or not. The actor is not guaranteed to be alive and responding even
though :meth:`is_alive` returns :class:`True`.
:return:
Returns :class:`True` if actor is alive, :class:`False` otherwise.
"""
return _ActorRegistry.get_by_urn(self.actor_urn) is not None
示例2: test_get_by_urn_returns_none_if_not_found
# 需要导入模块: from pykka.registry import ActorRegistry [as 别名]
# 或者: from pykka.registry.ActorRegistry import get_by_urn [as 别名]
def test_get_by_urn_returns_none_if_not_found(self):
result = ActorRegistry.get_by_urn('urn:foo:bar')
self.assertEqual(None, result)
示例3: on_start
# 需要导入模块: from pykka.registry import ActorRegistry [as 别名]
# 或者: from pykka.registry.ActorRegistry import get_by_urn [as 别名]
def on_start(self):
self.on_start_was_called.set()
if ActorRegistry.get_by_urn(self.actor_urn) is not None:
self.actor_was_registered_before_on_start_was_called.set()
示例4: test_actors_may_be_looked_up_by_urn
# 需要导入模块: from pykka.registry import ActorRegistry [as 别名]
# 或者: from pykka.registry.ActorRegistry import get_by_urn [as 别名]
def test_actors_may_be_looked_up_by_urn(self):
result = ActorRegistry.get_by_urn(self.a_actor_0_urn)
self.assertEqual(self.a_actors[0], result)