This is the main Server class.
New in version 0.1-beta6.
Object mapping route names to MethodsRegister objects (or equivalent), containing the actual methods to be exposed.
In the default implementation, this is a defaultdict, allowing to write things like this, without having to care about creating the MethodsRegister object manually:
@server.routes['hello_world'].register
def hello(request):
return "World"
A property pointing to routes['']. Mostly for background compatibility, this might be deprecated in future versions.
The class to be used for unpacking the message from the client and pack the response before sending. Defaults to CustomMsgPackSerializer.
Middleware objects to be called before/after processing requests.
Bind the server socket to an address (or a list of)
Beware! Only .bind() or .connect() may be called on a given server instance!
Params addresses: | |
---|---|
A (list of) address(es) to which to bind the server. |
Connect the server socket to an address (or a list of)
Beware! Only .bind() or .connect() may be called on a given server instance!
Params addresses: | |
---|---|
A (list of) address(es) to which to connect the server. |