cyclone.jsonrpc — JSON-encoded Remote Procedure Call

Server-side implementation of the JSON-RPC protocol.

JSON-RPC is a lightweight remote procedure call protocol, designed to be simple.

For more information, check out the RPC demo.

class cyclone.jsonrpc.JsonrpcRequestHandler(application, request, **kwargs)[source]

Subclass this class and define jsonrpc_* to make a handler.


class MyRequestHandler(JsonrpcRequestHandler):
    def jsonrpc_echo(self, text):
        return text

    def jsonrpc_sort(self, items):
        return sorted(items)

    def jsonrpc_geoip_lookup(self, address):
        response = yield cyclone.httpclient.fetch(
            "" % address.encode("utf-8"))

Previous topic

cyclone.xmlrpc — XML-encoded Remote Procedure Call

Next topic

cyclone.websocket — Bidirectional communication to the browser

This Page