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


Python ActorRegistry.get_by_urn方法代码示例

本文整理汇总了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
开发者ID:zombiecalypse,项目名称:pykka,代码行数:14,代码来源:actor.py

示例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)
开发者ID:benjixx,项目名称:pykka,代码行数:5,代码来源:registry_test.py

示例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()
开发者ID:PabloTunnon,项目名称:pykka-deb,代码行数:6,代码来源:actor_test.py

示例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)
开发者ID:benjixx,项目名称:pykka,代码行数:5,代码来源:registry_test.py


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