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')
def get_rpc_server(transport, target, endpoints, executor='blocking', serializer=None): return server.RPCServer( transport, target, dispatcher.RPCDispatcher(endpoints, serializer), executor )
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')
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', )
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')