Changes between Version 9 and Version 10 of Development/DelugeRPC


Ignore:
Timestamp:
06/08/2019 02:46:16 PM (2 years ago)
Author:
Cas
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Development/DelugeRPC

    v9 v10  
    1 = DelugeRPC = 
    2  
    3 == Overview == 
    4  
    5 DelugeRPC is a protocol used for daemon/client communication.  There are four types of messages involved in the protocol: [#RPCRequest RPC Request], [#RPCResponse RPC Response], [#RPCError RPC Error] and [#Event Event].  All messages are zlib compressed rencoded strings and their data formats are detailed below. 
    6  
    7 == Message Formats == 
    8  
    9 === RPC Request === 
    10  
    11 This message is created and sent by the client to the server requesting that a remote method be called.  Multiple requests can be bundled in a list. 
    12  
    13 [['''request_id''', '''method''', '''[args]''', '''{kwargs}'''], '''...'''] 
    14  
    15  '''''request_id''''' (int):: 
    16   An integer determined by the client that is used in replies from the server.  This is used to ensure the client knows which request the data is in response to.  Another alternative would be to respond in the same order the requests come in, but this could cause lag if an earlier request takes longer to process. 
    17  
    18  '''''method''''' (str):: 
    19   The name of the remote method to call.  This name can be in dotted format to call other objects or plugins methods. 
    20  
    21  '''''args''''' (list):: 
    22   The arguments to call the method with. 
    23  
    24  '''''kwargs''''' (dict):: 
    25   The keyword arguments to call the method with. 
    26  
    27 === RPC Response === 
    28  
    29 This message is created and sent in response to a RPC Request from a client.  It will hold the return value of the requested method call.  In the case of an error, a RPC Error message will be sent instead. 
    30  
    31 ['''message_type''', '''request_id''', '''[return_value]'''] 
    32  
    33  '''''message_type''''' (int):: 
    34   This will be a RPC_RESPONSE type id.  This is used on the client side to determine what kind of message is being received from the daemon. 
    35  
    36  '''''request_id''''' (int):: 
    37   The request_id is the same as the one sent by the client in the initial request.  It used on the client side to determine what message this is in response to. 
    38  
    39  '''''return_value''''' (list):: 
    40   The return value of the method call. 
    41  
    42 === RPC Error === 
    43  
    44 This message is created in response to an error generated while processing a RPC Request and will serve as a replacement for a RPC Response message. 
    45  
    46 ['''message_type''', '''request_id''', '''exception_type''', '''exception_msg''', '''traceback'''] 
    47  
    48  '''''message_type''''' (int):: 
    49   This will be a RPC_ERROR type id. 
    50  
    51  '''''request_id''''' (int):: 
    52   The request_id is the same as the one sent by the client in the initial request. 
    53  
    54  '''''exception_type''''' (str):: 
    55   The type of exception raised. 
    56  
    57  '''''exception_msg''''' (str):: 
    58   The message as to why the exception was raised. 
    59  
    60  '''''traceback''''' (str):: 
    61   The traceback of the generated exception. 
    62  
    63 === Event === 
    64  
    65 This message is created by the daemon and sent to the clients without being in response to a RPC Request.  Events are generally sent for changes in the daemon's state that the clients need to be made aware of. 
    66  
    67 ['''message_type''', '''event_name''', '''data'''] 
    68  
    69  '''''message_type''''' (int):: 
    70   This will be a RPC_EVENT type id. 
    71  
    72  '''''event_name''''' (str):: 
    73   This is the name of the event being emitted by the daemon. 
    74  
    75  '''''data''''' (list):: 
    76   Additional data to be sent with the event.  This is dependent upon the event being emitted. 
     1Moved to: https://deluge.readthedocs.io/en/develop/reference/rpc.html