Module Import alias Import alias ImportFrom alias FunctionDef arguments args NameParam defaults NameLoad body Expr Str If Call NameLoad NameLoad body Assign NameStore NameLoad Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr Return NameLoad FunctionDef arguments args NameParam defaults body Assign AttributeStore NameLoad attr BoolOpOr NameLoad AttributeLoad NameLoad attr Return NameLoad decorator_list Return NameLoad decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam defaults body Assign AttributeStore NameLoad attr Dict Assign AttributeStore NameLoad attr Dict decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults Str body Expr Str Expr Call AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad ListLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad body Expr Str Assert Call NameLoad NameLoad Str If UnaryOpNot NameLoad body Assign NameStore AttributeLoad NameLoad attr If CompareIn NameLoad AttributeLoad NameLoad attr body Raise Call NameLoad Str Assign SubscriptStore AttributeLoad NameLoad attr Index NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str If Call NameLoad NameLoad Str body Assign NameStore ListComp Call AttributeLoad NameLoad attr NameLoad comprehension NameStore NameLoad Assign NameStore Call AttributeLoad NameLoad attr If CompareNotEq NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad Return NameLoad orelse Return Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body TryExcept body TryExcept body Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr handlers ExceptHandler type NameLoad name NameStore body Return Call AttributeLoad NameLoad attr Call NameLoad NameLoad TryExcept body Assign NameStore Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr handlers ExceptHandler type NameLoad name NameStore body Return Call AttributeLoad NameLoad attr NameLoad Return Call AttributeLoad NameLoad attr NameLoad handlers ExceptHandler type NameLoad name NameStore body Return Call AttributeLoad NameLoad attr Call NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str If CompareIn NameLoad AttributeLoad NameLoad attr body Return SubscriptLoad AttributeLoad NameLoad attr Index NameLoad For TupleStore NameStore NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr body If Call AttributeLoad NameLoad attr NameLoad body For NameStore NameLoad body TryExcept body Return Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Slice Call NameLoad NameLoad handlers ExceptHandler type NameLoad body Pass Raise Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad body Expr Str If Call NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad Return NameLoad FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr NameLoad keyword NameLoad Return NameLoad decorator_list Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults Str body Expr Str Assign NameStore Call AttributeLoad NameLoad attr For TupleStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad Lambda arguments args NameParam defaults BoolOpAnd Call NameLoad NameLoad Call NameLoad NameLoad Str body Expr Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list decorator_list
N/A N/A six N/A inspect exc * public N/A N/A name N/A None N/A N/A Set RPC name on function.

    This function decorator will set the ``_rpc_public_name`` attribute on a
    function, causing it to be picked up if an instance of its parent class is
    registered using
    :py:func:`~tinyrpc.dispatch.RPCDispatcher.register_instance`.

    ``@public`` is a shortcut for ``@public()``.

    :param name: The name to register the function with.
     N/A N/A callable name N/A N/A f name N/A N/A f _rpc_public_name N/A f __name__ N/A f _ N/A N/A f N/A N/A N/A N/A f _rpc_public_name N/A name N/A f __name__ N/A f N/A N/A _ N/A RPCDispatcher N/A object N/A N/A Stores name-to-method mappings. __init__ N/A N/A self N/A N/A N/A N/A self method_map N/A N/A N/A self subdispatchers N/A N/A add_subdispatch N/A N/A self dispatcher prefix N/A N/A N/A Adds a subdispatcher, possibly in its own namespace.

        :param dispatcher: The dispatcher to add as a subdispatcher.
        :param prefix: A prefix. All of the new subdispatchers methods will be
                       available as prefix + their original name.
         N/A N/A N/A N/A N/A N/A self subdispatchers setdefault prefix N/A append dispatcher N/A add_method N/A N/A self f name N/A None N/A N/A Add a method to the dispatcher.

        :param f: Callable to be added.
        :param name: Name to register it with. If ``None``, ``f.__name__`` will
                     be used.
         N/A N/A callable f method argument must be callable N/A N/A name N/A N/A name N/A f __name__ N/A N/A name N/A self method_map N/A N/A N/A RPCError Name %s already registered N/A N/A N/A self method_map N/A name f N/A dispatch N/A N/A self request N/A N/A N/A Fully handle request.

        The dispatch method determines which method to call, calls it and
        returns a response containing a result.

        No exceptions will be thrown, rather, every exception will be turned
        into a response using :py:func:`~tinyrpc.RPCRequest.error_respond`.

        If a method isn't found, a :py:exc:`~tinyrpc.exc.MethodNotFoundError`
        response will be returned. If any error occurs outside of the requested
        method, a :py:exc:`~tinyrpc.exc.ServerError` without any error
        information will be returend.

        If the method is found and called but throws an exception, the
        exception thrown is used as a response instead. This is the only case
        in which information from the exception is possibly propagated back to
        the client, as the exception is part of the requested method.

        :py:class:`~tinyrpc.RPCBatchRequest` instances are handled by handling
        all its children in order and collecting the results, then returning an
        :py:class:`~tinyrpc.RPCBatchResponse` with the results.

        :param request: An :py:func:`~tinyrpc.RPCRequest`.
        :return: An :py:func:`~tinyrpc.RPCResponse`.
         N/A N/A hasattr request create_batch_response N/A N/A results N/A N/A N/A self _dispatch req N/A req request N/A response N/A N/A request create_batch_response N/A N/A response None N/A N/A N/A N/A response extend results N/A response N/A N/A N/A N/A self _dispatch request N/A _dispatch N/A N/A self request N/A N/A N/A N/A N/A N/A N/A method N/A N/A self get_method N/A request method N/A N/A N/A KeyError N/A e N/A N/A N/A N/A request error_respond N/A MethodNotFoundError e N/A N/A N/A result N/A method N/A request args N/A request kwargs N/A N/A N/A Exception N/A e N/A N/A N/A N/A request error_respond e N/A N/A N/A request respond result N/A N/A N/A Exception N/A e N/A N/A N/A N/A request error_respond N/A ServerError N/A get_method N/A N/A self name N/A N/A N/A Retrieve a previously registered method.

        Checks if a method matching ``name`` has been registered.

        If :py:func:`get_method` cannot find a method, every subdispatcher
        with a prefix matching the method name is checked as well.

        If a method isn't found, a :py:class:`KeyError` is thrown.

        :param name: Callable to find.
        :param return: The callable.
         N/A N/A name N/A self method_map N/A N/A N/A N/A self method_map N/A name N/A N/A prefix subdispatchers N/A N/A six iteritems N/A self subdispatchers N/A N/A N/A N/A name startswith prefix N/A N/A sd subdispatchers N/A N/A N/A N/A N/A N/A sd get_method N/A name N/A N/A len prefix N/A N/A N/A KeyError N/A N/A N/A N/A KeyError name N/A public N/A N/A self name N/A None N/A N/A Convenient decorator.

        Allows easy registering of functions to this dispatcher. Example:

        .. code-block:: python

            dispatch = RPCDispatcher()

            @dispatch.public
            def foo(bar):
                # ...

            class Baz(object):
                def not_exposed(self):
                    # ...

                @dispatch.public(name='do_something')
                def visible_method(arg1)
                    # ...

        :param name: Name to register callable with
         N/A N/A callable name N/A N/A N/A N/A self add_method name N/A name _ N/A N/A f N/A N/A N/A N/A N/A self add_method f name name N/A f N/A N/A _ N/A register_instance N/A N/A self obj prefix N/A N/A N/A Create new subdispatcher and register all public object methods on
        it.

        To be used in conjunction with the :py:func:`tinyrpc.dispatch.public`
        decorator (*not* :py:func:`tinyrpc.dispatch.RPCDispatcher.public`).

        :param obj: The object whose public methods should be made available.
        :param prefix: A prefix for the new subdispatcher.
         N/A dispatch N/A N/A self __class__ N/A N/A name f N/A N/A inspect getmembers obj N/A N/A N/A f N/A N/A N/A callable f N/A hasattr f _rpc_public_name N/A N/A N/A N/A dispatch add_method f N/A f _rpc_public_name N/A N/A N/A self add_subdispatch dispatch prefix N/A N/A