Skip to content

bashkirtsevich-llc/aiokrpc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Asyncio Kademlia RPC-server

Build Status

Kademlia protocol based RPC-server.

Example

import asyncio

loop = asyncio.get_event_loop()

udp = UDPServer()
udp.run("0.0.0.0", 12346, loop=loop)

app = KRPCServer(server=udp, loop=loop)

@app.callcack(arg_schema={"id": {"type": "integer", "required": True}})
def ping(addr, id):
    print(addr, id)
    return {"id": id}

if __name__ == '__main__':
    loop.run_forever()