示例#1
0
文件: proxy.py 项目: okoye/pykka
 def __init__(self, actor_ref, attr_path=None):
     if not actor_ref.is_alive():
         raise _ActorDeadError('%s not found' % actor_ref)
     self.actor_ref = actor_ref
     self._attr_path = attr_path or tuple()
     self._known_attrs = None
     self._actor_proxies = {}
     self._callable_proxies = {}
示例#2
0
文件: proxy.py 项目: garindra/pykka
 def __init__(self, actor_ref, attr_path=None):
     if not actor_ref.is_alive():
         raise _ActorDeadError('%s not found' % actor_ref)
     self.actor_ref = actor_ref
     # pylint: disable = W0212
     self._actor = actor_ref._actor
     # pylint: enable = W0212
     self._attr_path = attr_path or tuple()
     self._known_attrs = self._get_attributes()
     self._actor_proxies = {}
     self._callable_proxies = {}
示例#3
0
 def __init__(self, actor_ref, attr_path=None):
     if not actor_ref.is_alive():
         raise _ActorDeadError('%s not found' % actor_ref)
     self.actor_ref = actor_ref
     # pylint: disable = W0212
     self._actor = actor_ref._actor
     # pylint: enable = W0212
     self._attr_path = attr_path or tuple()
     self._known_attrs = self._get_attributes()
     self._actor_proxies = {}
     self._callable_proxies = {}
示例#4
0
    def send_one_way(self, message):
        """
        Send message to actor without waiting for any response.

        Will generally not block, but if the underlying queue is full it will
        block until a free slot is available.

        :param message: message to send
        :type message: picklable dict

        :raise: :exc:`pykka.ActorDeadError` if actor is not available
        :return: nothing
        """
        if not self.is_alive():
            raise _ActorDeadError('%s not found' % self)
        self.actor_inbox.put(message)
示例#5
0
    def tell(self, message):
        """
        Send message to actor without waiting for any response.

        Will generally not block, but if the underlying queue is full it will
        block until a free slot is available.

        :param message: message to send
        :type message: picklable dict

        :raise: :exc:`pykka.ActorDeadError` if actor is not available
        :return: nothing
        """
        if not self.is_alive():
            raise _ActorDeadError('%s not found' % self)
        self.actor_inbox.put(message)