himbeerecouch.rpc

Exceptions

class himbeerecouch.rpc.ProcessImporter(modules, exported_commands=None)[source]

Handles importing classes/modules from code in database.

See start_new_process() for an example of how this is used.

class himbeerecouch.rpc.RPCProxy(address, authkey)[source]

RPCProxy, object running in child processes that connects to an RPCServer object.

class himbeerecouch.rpc.RPCServer(address, authkey)[source]

RPC (Remote-Procedure-Call server)

Calls remote procedures on all child processes

himbeerecouch.rpc.id_generator(size=6, chars='ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789')[source]

Generates random ID, used for private shared key between processes

himbeerecouch.rpc.start_new_process(name, code)[source]

Start new child process

Parameters:
  • name (str) – Name of child process
  • code (dict) – code to run, dictionary of modules (in string format)
Returns:

(multiprocessing.Process, multiprocessing.Queue)

The Queue returned has the result returned from the child process:

{ "ok" : True }

when everything ok, and:

{ "error" : ...traceback... }

when not.