Welcome to Tavrida’s documentation!¶
Contents¶
Indices and tables¶
Brief service example¶
Hello service
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | from tavrida import config
from tavrida import dispatcher
from tavrida import server
from tavrida import service
@dispatcher.rpc_service("test_hello")
class HelloController(service.ServiceController):
@dispatcher.rpc_method(service="test_hello", method="hello")
def handler(self, request, proxy, param):
print param
def run():
creds = config.Credentials("guest", "guest")
conf = config.ConnectionConfig("localhost", credentials=creds,
async_engine=True)
srv = server.Server(conf,
queue_name="test_service",
exchange_name="test_exchange",
service_list=[HelloController])
srv.run()
|