Exemple #1
0
    def __init__(self, process=None, **kwargs):
        self._process = process

        if 'to_name' in kwargs and kwargs['to_name'] is not None and not isinstance(kwargs['to_name'], BaseTransport):
            container = (hasattr(self._process, 'container') and self._process.container) or self._get_container_instance()
            if container:
                kwargs['to_name'] = container.create_xn_service(kwargs['to_name'])
            else:
                log.info('No container at ProcessRPCClient init time, will wait until message send to upgrade to Exchange Object')

        RPCClient.__init__(self, **kwargs)
Exemple #2
0
    def __init__(self, process=None, **kwargs):
        self._process = process

        if 'to_name' in kwargs and kwargs['to_name'] is not None and not isinstance(kwargs['to_name'], BaseTransport):
            container = (hasattr(self._process, 'container') and self._process.container) or self._get_container_instance()
            if container:
                # Client creates the service XN
                kwargs['to_name'] = container.create_service_xn(kwargs['to_name'])
            else:
                log.info('No container at ProcessRPCClient init time, will wait until message send to upgrade to Exchange Object')

        RPCClient.__init__(self, **kwargs)
Exemple #3
0
    def __init__(self, process=None, **kwargs):
        self._process = process
        self._declare_name = kwargs.pop("declare_name", True)  # MM: Prevent senders from declaring with wrong AMQP properties

        if 'to_name' in kwargs and kwargs['to_name'] is not None and not isinstance(kwargs['to_name'], BaseTransport):
            container = (hasattr(self._process, 'container') and self._process.container) or self._get_container_instance()
            if container:
                if self._declare_name:
                    # NOTE: What if this is a process or agent client? Cannot declare with known properties.
                    # Client creates the service XN
                    kwargs['to_name'] = container.create_service_xn(kwargs['to_name'])
            else:
                log.info('No container at ProcessRPCClient init time, will wait until message send to upgrade to Exchange Object')

        RPCClient.__init__(self, **kwargs)
Exemple #4
0
    def __init__(self, process=None, **kwargs):
        self._process = process
        self._declare_name = kwargs.pop(
            "declare_name", True
        )  # MM: Prevent senders from declaring with wrong AMQP properties

        if 'to_name' in kwargs and kwargs[
                'to_name'] is not None and not isinstance(
                    kwargs['to_name'], BaseTransport):
            container = (
                hasattr(self._process, 'container')
                and self._process.container) or self._get_container_instance()
            if container:
                if self._declare_name:
                    # NOTE: What if this is a process or agent client? Cannot declare with known properties.
                    # Client creates the service XN
                    kwargs['to_name'] = container.create_service_xn(
                        kwargs['to_name'])
            else:
                log.info(
                    'No container at ProcessRPCClient init time, will wait until message send to upgrade to Exchange Object'
                )

        RPCClient.__init__(self, **kwargs)
Exemple #5
0
 def __init__(self, process=None, **kwargs):
     self._process = process
     RPCClient.__init__(self, **kwargs)
 def __init__(self, to_name=None, node=None, **kwargs):
     to_name = to_name or __name__ + "test"
     RPCClient.__init__(self, to_name=to_name, node=node, **kwargs)
Exemple #7
0
 def __init__(self, process=None, **kwargs):
     self._process = process
     RPCClient.__init__(self, **kwargs)
 def __init__(self, to_name=None, node=None, **kwargs):
     to_name = to_name or __name__ + "test"
     RPCClient.__init__(self, to_name=to_name, node=node, **kwargs)