コード例 #1
0
ファイル: rpc.py プロジェクト: bopopescu/OpenStack-Ocata
def get_server(target, endpoints, serializer=None):
    assert TRANSPORT is not None
    if serializer is None:
        serializer = DesignateObjectSerializer()
    serializer = RequestContextSerializer(serializer)
    dispatcher = RPCDispatcher(endpoints, serializer)
    return rpc_server.RPCServer(TRANSPORT, target, dispatcher, 'eventlet')
コード例 #2
0
ファイル: rpc.py プロジェクト: xavierhardy/mistral
def get_rpc_server(transport, target, endpoints, executor='blocking',
                   serializer=None):
    return server.RPCServer(
        transport,
        target,
        dispatcher.RPCDispatcher(endpoints, serializer),
        executor
    )
コード例 #3
0
ファイル: rpc.py プロジェクト: menkeyi/designate
def get_server(target, endpoints, serializer=None):
    assert TRANSPORT is not None
    if serializer is None:
        serializer = DesignateObjectSerializer()
    serializer = RequestContextSerializer(serializer)
    access_policy = rpc_dispatcher.DefaultRPCAccessPolicy
    dispatcher = RPCDispatcher(endpoints, serializer, access_policy)
    return rpc_server.RPCServer(
        TRANSPORT, target, dispatcher, 'eventlet')
コード例 #4
0
def get_server(target, endpoints, serializer=None):
    if TRANSPORT is None:
        raise AssertionError("'TRANSPORT' must not be None")
    if serializer is None:
        serializer = DesignateObjectSerializer()
    serializer = RequestContextSerializer(serializer)
    access_policy = rpc_dispatcher.DefaultRPCAccessPolicy
    dispatcher = RPCDispatcher(endpoints, serializer, access_policy)
    return rpc_server.RPCServer(
        TRANSPORT,
        target,
        dispatcher=dispatcher,
        executor='eventlet',
    )
コード例 #5
0
def get_server(target, endpoints, serializer=None):
    assert TRANSPORT is not None
    if serializer is None:
        serializer = DesignateObjectSerializer()
    serializer = RequestContextSerializer(serializer)

    # TODO(kiall): Remove when oslo.messaging 5 is the min in requirements
    argspec = inspect.getargspec(rpc_dispatcher.RPCDispatcher.__init__)
    if 'target' in argspec.args:
        # We're on oslo.messaging < 5
        dispatcher = RPCDispatcher(target, endpoints, serializer)

        return msg_server.MessageHandlingServer(TRANSPORT, dispatcher,
                                                'eventlet')

    else:
        # We're on oslo.messaging >= 5
        dispatcher = RPCDispatcher(endpoints, serializer)

        return rpc_server.RPCServer(TRANSPORT, target, dispatcher, 'eventlet')