[V3 RPC] Initial RPC library switch (#1634)

* Initial RPC library switch

* Use weak refs to the methods so cog unload works

* Add docs

* Black fixes

* Add jsonrpcserver to Pipfile.lock
This commit is contained in:
Will
2018-05-22 20:29:26 -04:00
committed by palmtree5
parent abfee70eb3
commit 73a427f6aa
8 changed files with 179 additions and 99 deletions

View File

@@ -4,5 +4,36 @@
RPC
===
.. automodule:: redbot.core.rpc
.. currentmodule:: redbot.core.rpc
V3 comes default with an internal RPC server that may be used to remotely control the bot in various ways.
Cogs must register functions to be exposed to RPC clients.
Each of those functions must only take JSON serializable parameters and must return JSON serializable objects.
To begin, register all methods using individual calls to the :func:`Methods.add` method.
********
Examples
********
Coming soon to a docs page near you!
*************
API Reference
*************
.. py:attribute:: redbot.core.rpc.methods
An instance of the :class:`Methods` class.
All attempts to register new RPC methods **MUST** use this object.
You should never create a new instance of the :class:`Methods` class!
RPC
^^^
.. autoclass:: redbot.core.rpc.RPC
:members:
Methods
^^^^^^^
.. autoclass:: redbot.core.rpc.Methods
:members: