Last active
January 9, 2019 09:26
-
-
Save xiaotangyuan/3e581067dbd00d0e885f40fc74b90ea6 to your computer and use it in GitHub Desktop.
use nameko
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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