Пример #1
0
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
def get_rpc_server(transport, target, endpoints, executor='blocking',
                   serializer=None):
    return server.RPCServer(
        transport,
        target,
        dispatcher.RPCDispatcher(endpoints, serializer),
        executor
    )
Пример #3
0
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')