예제 #1
0
파일: actor.py 프로젝트: jstasiak/pykka
    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
0
    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
예제 #3
0
 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
0
 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()
예제 #5
0
 def test_get_by_urn_returns_none_if_not_found(self):
     result = ActorRegistry.get_by_urn('urn:foo:bar')
     self.assertEqual(None, result)
예제 #6
0
 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)
예제 #7
0
 def test_get_by_urn_returns_none_if_not_found(self):
     result = ActorRegistry.get_by_urn('urn:foo:bar')
     self.assertEqual(None, result)
예제 #8
0
 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)