def __init__(self, conf, matchmaker=None, allowed_remote_exmods=None):

        default_publisher = zmq_dealer_publisher.DealerPublisher(
            conf, matchmaker) if not conf.direct_over_proxy else \
            zmq_dealer_publisher.DealerPublisherLight(
                conf, zmq_address.get_broker_address(conf))

        fanout_publisher = zmq_dealer_publisher.DealerPublisherLight(
            conf, zmq_address.get_broker_address(conf)) \
            if conf.use_pub_sub else default_publisher

        super(ZmqClient, self).__init__(
            conf,
            matchmaker,
            allowed_remote_exmods,
            publishers={
                zmq_names.CALL_TYPE:
                zmq_dealer_call_publisher.DealerCallPublisher(
                    conf, matchmaker),

                # Here use DealerPublisherLight for sending request to proxy
                # which finally uses PubPublisher to send fanout in case of
                # 'use_pub_sub' option configured.
                zmq_names.CAST_FANOUT_TYPE:
                fanout_publisher,
                zmq_names.NOTIFY_TYPE:
                fanout_publisher,
                "default":
                default_publisher
            })
예제 #2
0
    def __init__(self, conf, matchmaker=None, allowed_remote_exmods=None):

        default_publisher = zmq_dealer_publisher.DealerPublisher(
            conf, matchmaker)

        cast_publisher = zmq_dealer_publisher.DealerPublisherAsync(
            conf, matchmaker) \
            if zmq_async.is_eventlet_concurrency(conf) \
            else default_publisher

        fanout_publisher = zmq_dealer_publisher.DealerPublisherLight(
            conf, matchmaker) if conf.use_pub_sub else default_publisher

        super(ZmqClient, self).__init__(
            conf,
            matchmaker,
            allowed_remote_exmods,
            publishers={
                zmq_names.CALL_TYPE:
                zmq_dealer_call_publisher.DealerCallPublisher(
                    conf, matchmaker),
                zmq_names.CAST_TYPE:
                cast_publisher,

                # Here use DealerPublisherLight for sending request to proxy
                # which finally uses PubPublisher to send fanout in case of
                # 'use_pub_sub' option configured.
                zmq_names.CAST_FANOUT_TYPE:
                fanout_publisher,
                zmq_names.NOTIFY_TYPE:
                fanout_publisher,
                "default":
                default_publisher
            })