Module bjsonrpc.handlers

class bjsonrpc.handlers.BaseHandler(connection)

Base Class to publish remote methods. It is instantiated by Connection.

Example:

class MyHandler(bjson.handlers.BaseHandler):
    def _setup(self):
        # Initailize here.
        self.c = 0
        
    def echo(self,text): 
        print text
        self.c += 1
        
    def getcount(self): return c
add_method(*args, **kwargs)
Porcelain for publishing methods into the handler. Is used by the constructor itself to publish all non-private functions.
close()
Cleans some variables before the object is freed. _close is called manually from connection whenever a handler is going to be deleted.
get_method(name)
Porcelain for resolving method objects from their names. Used by connections to get the apropiate method object.
class bjsonrpc.handlers.NullHandler(connection)

Null version of BaseHandler which has nothing in it. Use this when you don’t want to publish any function.

add_method(*args, **kwargs)
Porcelain for publishing methods into the handler. Is used by the constructor itself to publish all non-private functions.
close()
Cleans some variables before the object is freed. _close is called manually from connection whenever a handler is going to be deleted.
get_method(name)
Porcelain for resolving method objects from their names. Used by connections to get the apropiate method object.

Previous topic

Module bjsonrpc.request

Next topic

Module bjsonrpc.proxies

This Page