File: rpc_echo.py

package info (click to toggle)
python-bumps 0.7.11-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 10,264 kB
  • sloc: python: 22,226; ansic: 4,973; cpp: 4,849; xml: 493; makefile: 163; perl: 108; sh: 101
file content (16 lines) | stat: -rw-r--r-- 350 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import time

from amqp_map.core import connect
from amqp_map.config import SERVICE_HOST
from amqp_map.rpc import RPCMixin

server = connect(SERVICE_HOST)

class Echo(object,RPCMixin):
    def __init__(self, server):
        self.rpc_init(server, service="echo")
    def echo(self, msg):
        return msg

service = Echo(server)
service.rpc_serve()