Module Expr Str Import alias ImportFrom alias Assign NameStore TupleLoad Str Str Str ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam defaults body Expr Str ImportFrom alias TryExcept body If CompareEq SubscriptLoad SubscriptLoad NameLoad Index Num Slice Num Str body Raise Call NameLoad Str If CompareEq Call NameLoad NameLoad Num body Assign NameStore ListLoad SubscriptLoad NameLoad Index Num Dict If UnaryOpNot Call NameLoad NameLoad SubscriptLoad NameLoad Index Num body Return Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num Assign NameStore Call NameLoad NameLoad SubscriptLoad NameLoad Index Num Return Call NameLoad SubscriptLoad NameLoad Index Num handlers ExceptHandler body Expr Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr BinOpAdd Str Call NameLoad Return ListLoad Str Call NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults kwarg body Expr Str Return ListLoad Str NameLoad NameLoad decorator_list FunctionDef arguments args defaults body Expr Str ImportFrom alias alias ClassDef bases NameLoad body FunctionDef arguments args NameParam defaults body Return Str decorator_list FunctionDef arguments args NameParam NameParam defaults body Return BinOpMult NameLoad NameLoad decorator_list decorator_list FunctionDef arguments args defaults body Assign NameStore Call AttributeLoad Call NameLoad Call NameLoad Str Num attr Call NameLoad For TupleStore NameStore NameStore Call NameLoad Call NameLoad Num NameLoad body Expr Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr decorator_list ImportFrom alias Assign NameStore Call NameLoad keyword Str keyword NameLoad Assign AttributeStore NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Assign NameStore Call NameLoad Call NameLoad Str Num Assign NameStore ListLoad Str Assign NameStore Call NameLoad NameLoad Print BinOpMod Str NameLoad Assign NameStore ListLoad Str Dict Str Num Assign NameStore Call NameLoad NameLoad Print BinOpMod Str NameLoad Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr decorator_list NameLoad decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam defaults body Assign AttributeStore NameLoad attr TupleLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad body If UnaryOpNot NameLoad body Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index Num Return SubscriptLoad SubscriptLoad SubscriptLoad AttributeLoad NameLoad attr Index Num Index Str Index NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return SubscriptLoad AttributeLoad NameLoad attr Index Num decorator_list decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str ImportFrom alias alias Assign NameStore SubscriptLoad SubscriptLoad NameLoad Index Str Index NameLoad Assign NameStore SubscriptLoad NameLoad Index Str Assign NameStore Call AttributeLoad Call NameLoad SubscriptLoad NameLoad Index Str SubscriptLoad NameLoad Index Str attr Call AttributeLoad NameLoad attr Str NameLoad If CompareIn Str NameLoad body Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Str If BoolOpAnd CompareIn Str NameLoad UnaryOpNot AttributeLoad NameLoad attr body Assign AttributeStore NameLoad attr BinOpMod Str NameLoad Assign NameStore Call NameLoad SubscriptLoad NameLoad Index Str For NameStore SubscriptLoad Call AttributeLoad SubscriptLoad NameLoad Index Str attr Str Slice Num body Assign NameStore Call NameLoad NameLoad NameLoad Assign NameStore Call NameLoad NameLoad SubscriptLoad NameLoad Index Str Return Call AttributeLoad Call NameLoad NameLoad attr Call NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args defaults body Import alias Return Call AttributeLoad NameLoad attr decorator_list If CompareEq NameLoad Str body ImportFrom alias alias Expr Call NameLoad
N/A N/A  Base classes for use by workers (not intended to be used outside this module.
 N/A json itertools izip N/A __all__ N/A ZeroRPC ConfiguredRPC zrpc ZeroRPC N/A object N/A N/A  Inherit and implement your own methods on from this.
        Then supply to ZeroSetup:

        Zero(ZeroSetup('pull', 8000)).activated(ZeroRPC())
     __call__ N/A N/A self obj N/A N/A N/A Calls the method from obj (always of the form [<method name>, {<kwargs>}]). traceback format_exc N/A N/A N/A N/A N/A N/A obj N/A 0 N/A 1 _ N/A N/A N/A Exception Method not available N/A N/A N/A len obj 1 N/A N/A obj N/A N/A obj N/A 0 N/A N/A N/A N/A hasattr self N/A obj N/A 0 N/A N/A N/A N/A self _unsupported N/A obj N/A 0 N/A obj N/A 1 N/A func N/A getattr self N/A obj N/A 0 N/A N/A func N/A obj N/A 1 N/A N/A N/A N/A N/A N/A N/A N/A self zero setup err N/A Exception:  N/A format_exc N/A N/A ERROR N/A format_exc N/A _unsupported N/A N/A self func N/A kwargs N/A N/A Catch-all method for when the object received does not fit. N/A N/A UnsupportedFunc func kwargs N/A _test_rpc N/A N/A N/A N/A N/A  For doctest
            >>> from zero.rpc import ZeroRPC
            >>> ZeroRPC._test_rpc()
            REP u'hello'
            REP 100
         zero Zero ZeroSetup Z N/A ZeroRPC N/A hi N/A N/A self N/A N/A N/A hello N/A sqr N/A N/A self x N/A N/A N/A N/A x x N/A N/A listen N/A N/A N/A N/A N/A zero N/A N/A N/A Zero N/A ZeroSetup rep 8000 activated N/A Z N/A N/A _ msg N/A izip N/A range 2 zero N/A N/A N/A zero msg N/A N/A N/A zero close N/A threading Thread N/A t N/A Thread name TestRPC target listen N/A N/A t daemon True N/A N/A N/A t start N/A zero N/A Zero N/A ZeroSetup req 8000 N/A msg N/A hi N/A rep N/A zero msg N/A N/A REP %r rep N/A msg N/A sqr N/A x 10 N/A rep N/A zero msg N/A N/A REP %r rep N/A N/A N/A zero close N/A N/A N/A t join N/A staticmethod N/A ConfiguredRPC N/A ZeroRPC N/A N/A  Does not implement any RPC methods. This class adds methods and members for accessing 
        system configuration.

        System configuration as json looks like this:
        {
            "workers": {
                "imagestore": {
                    "module": "noep.workers.store",
                    "class": "ImageStoreRPC",
                    "zmq": {
                        "method": "rep",
                        "port": 8805,
                        "debug": true,
                        "host": "localhost"
                    }
                },
                "gphoto": {
                    "module": "noep.workers.gphoto",
                    "class": "GphotoRPC",
                    "zmq": {
                        "method": "rep",
                        "port": 8804,
                        "debug": true,
                        "host": "localhost"
                    },
                    "filename": "gphoto-%n.%C"
                }
            }
        }

        Each worker has a module and class name as well as a zmq configuration. Additional keys
        may be added. zero.rpc will ignore everything outside of "workers" -> (worker type) -> 
        ["module", "class", "zmq" -> ["method", "port", "debug"*, "bind"*, "host"*]].

        *) optional

        To instantiate a worker from the config do something similar to this:

        from zero.rpc import zrpc
        from json import load
        with open('config.json') as fin:
            sysconfig = load(fin)
        rpc = zrpc(sysconfig, 'gphoto')
     __init__ N/A N/A self configuration workertype N/A N/A N/A N/A self _config N/A configuration workertype N/A _worker_config N/A N/A self workertype N/A None N/A N/A N/A workertype N/A N/A workertype N/A N/A self _config N/A 1 N/A N/A N/A N/A N/A self _config N/A 0 N/A workers N/A workertype N/A _system_config N/A N/A self N/A N/A N/A N/A N/A self _config N/A 0 N/A N/A zrpc N/A N/A sysconfig workertype N/A N/A N/A  Returns an activated Zero with RPC worker of type workertype as specified in sysconfig.
        >>> from .test import _get_test_config
        >>> from zero import zbg
        >>> from itertools import izip
        >>> from socket import gethostname
        >>> from time import time
        >>> cfg = _get_test_config()
        >>> z = zrpc(cfg, 'common')
        >>> o = z.opposite()
        >>> z  # doctest: +ELLIPSIS
        Zero(ZeroSetup('rep', 8000).binding(True)).activated(<zero.test.CommonRPC object at ...>)
        >>> o
        Zero(ZeroSetup('req', 8000).binding(False))
        >>> t = zbg(o, [['ping'], ['echo', {'msg': 'Hello'}], ['hostname'], ['time']], lambda x: x)
        >>> reps = []
        >>> for _, msg in izip(range(4), z):  # doctest: +ELLIPSIS
        ...     reps.append(msg)
        ...     z(msg)
        >>> reps[0]
        'pong'
        >>> reps[1]
        u'Hello'
        >>> reps[2] == gethostname()
        True
        >>> abs(time() - reps[3]) < 1
        True
        >>> t.join()
     zero Zero ZeroSetup N/A wconf N/A N/A sysconfig N/A workers N/A workertype N/A zconf N/A wconf N/A zmq N/A setup N/A N/A N/A ZeroSetup N/A zconf N/A method N/A zconf N/A port debugging N/A N/A zconf get debug False N/A N/A bind zconf N/A N/A N/A N/A setup binding N/A zconf N/A bind N/A N/A N/A host zconf N/A N/A setup bind N/A N/A N/A setup _point N/A tcp://%(host)s:%(port)s zconf N/A mod N/A __import__ N/A wconf N/A module N/A modpart N/A N/A N/A N/A wconf N/A module split . N/A 1 N/A N/A mod N/A getattr mod modpart N/A klass N/A getattr mod N/A wconf N/A class N/A N/A N/A N/A Zero setup activated N/A klass sysconfig workertype N/A _test N/A N/A N/A N/A N/A doctest N/A N/A N/A doctest testmod N/A N/A N/A __name__ __main__ N/A zero Zero ZeroSetup N/A N/A _test