Skip to content

Instantly share code, notes, and snippets.

@xiaotangyuan
Last active January 9, 2019 09:26
Show Gist options
  • Save xiaotangyuan/3e581067dbd00d0e885f40fc74b90ea6 to your computer and use it in GitHub Desktop.
Save xiaotangyuan/3e581067dbd00d0e885f40fc74b90ea6 to your computer and use it in GitHub Desktop.
use nameko
import os
from nameko.rpc import rpc
from nameko.cli import run
rabbit_config = {
'AMQP_URI': os.environ['AMQP_URI'],
'rpc_exchange': 'smstaskrpc',
'max_workers': 20,
'parent_calls_tracked': 10,
}
class XXService:
name = "xxservice"
@rpc
def send(self, sendinfo):
pass
return
if __name__ == '__main__':
import sys
services = [XXService]
run.run(services, rabbit_config)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment