Skip to content

Commit 445c860

Browse files
committed
Start 0.4 development. Update tornado to 3.0
1 parent b6fcbc9 commit 445c860

4 files changed

Lines changed: 12 additions & 13 deletions

File tree

msgpackrpc/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '0.3.3'
1+
__version__ = '0.4dev'

msgpackrpc/loop.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,30 +7,29 @@ class Loop(object):
77

88
@staticmethod
99
def instance():
10-
return Loop(ioloop.IOLoop.instance())
10+
return Loop(ioloop.IOLoop.current())
1111

1212
def __init__(self, loop=None):
1313
self._ioloop = loop or ioloop.IOLoop()
14+
self._ioloop.make_current()
1415
self._periodic_callback = None
1516

1617
def start(self):
1718
"""\
1819
Starts the Tornado's ioloop if it's not running.
1920
"""
2021

21-
if not self._ioloop.running():
22-
self._ioloop.start()
22+
self._ioloop.start()
2323

2424
def stop(self):
2525
"""\
2626
Stops the Tornado's ioloop if it's running.
2727
"""
2828

29-
if self._ioloop.running():
30-
try:
31-
self._ioloop.stop()
32-
except:
33-
return
29+
try:
30+
self._ioloop.stop()
31+
except:
32+
return
3433

3534
def attach_periodic_callback(self, callback, callback_time):
3635
if self._periodic_callback is not None:

msgpackrpc/transport/tcp.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import msgpack
2-
from tornado import netutil
2+
from tornado import tcpserver
33
from tornado.iostream import IOStream
44

55
import msgpackrpc.message
@@ -150,11 +150,11 @@ def on_notify(self, method, param):
150150
self._transport._server.on_notify(method, param)
151151

152152

153-
class MessagePackServer(netutil.TCPServer):
153+
class MessagePackServer(tcpserver.TCPServer):
154154
def __init__(self, transport, io_loop=None, encodings=None):
155155
self._transport = transport
156156
self._encodings = encodings
157-
netutil.TCPServer.__init__(self, io_loop=io_loop)
157+
tcpserver.TCPServer.__init__(self, io_loop=io_loop)
158158

159159
def handle_stream(self, stream, address):
160160
ServerSocket(stream, self._transport, self._encodings)

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
This implementation uses Tornado framework as a backend.
2323
""",
2424
packages=['msgpackrpc', 'msgpackrpc/transport'],
25-
install_requires=['msgpack-python', 'tornado < 3'],
25+
install_requires=['msgpack-python', 'tornado >= 3'],
2626
license="Apache Software License",
2727
classifiers=[
2828
'Programming Language :: Python :: 2',

0 commit comments

Comments
 (0)