Skip to content

Commit

Permalink
format code
Browse files Browse the repository at this point in the history
  • Loading branch information
rfyiamcool committed Nov 10, 2015
1 parent d3e5fc3 commit bea09f7
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 8 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

swift_rpc是用tornado实现的rpc服务,现在开放了四个调度接口:

(更多的关于swift的开发信息)[http://xiaorui.cc]

1. register 普通接口调用模式,最纯粹最简单
2. register_async 借助于tornado gen.coroutine实现的非堵塞调用
3. register_pool 借助于futures.ThreadPoolExecutor实现线程池
Expand All @@ -16,8 +18,8 @@ Version: 2.2
1. rq enqueue塞入任务队列时的一个bug,已经绕过解决

Future:
1. 使用rsa保证rpc通信安全
2. swift_rpc完善RQ异步任务队列
1. 使用rsa保证rpc通信安全
2. swift_rpc完善RQ异步任务队列

Tornado RPC Server Usage:

Expand Down
File renamed without changes.
5 changes: 1 addition & 4 deletions swift_rpc/server/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,8 @@ def register_mq(self, func):
def start(self, host, port):
self.log.info('Starting server on port {0}'.format(port))
# app = web.Application(self._routes, debug=True)
# app.listen(int(port),host)
# ioloop.IOLoop.current().start()

server = HTTPServer(web.Application(self._routes, debug=True),xheaders=True)
server.listen(port, host)
server.listen(int(port), host)
ioloop.IOLoop.current().start()

__all__ = ('RPCServer')
Expand Down
2 changes: 1 addition & 1 deletion swift_rpc/server/handlers.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from tornado import gen, log, web
from tornado.concurrent import run_on_executor
from concurrent.futures import ThreadPoolExecutor
from swift_rpc.scheduler import q,redis_conn
from swift_rpc.mq import q,redis_conn
from config import *

class _Handler(web.RequestHandler):
Expand Down
1 change: 0 additions & 1 deletion test_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ def test_block(args):
def test_async(arg):
raise gen.Return("You said async %s" % arg)


if __name__ == "__main__":
server = RPCServer()
server.register(test)
Expand Down

0 comments on commit bea09f7

Please sign in to comment.