Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit1deb0ae

Browse files
minrktakluyver
authored andcommitted
tornado 5: PeriodicCallback loop arg will be removed (#3034)
* tornado 5: PeriodicCallback loop arg will be removedPCs are always run with the current eventloop,which is what the explicitly passed loop always is for us already* Don't double-close socket & streamclosing stream closes the socket* remove now-inaccurate comment
1 parent5ede4c1 commit1deb0ae

File tree

3 files changed

+5
-9
lines changed

3 files changed

+5
-9
lines changed

‎notebook/base/zmqhandlers.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,14 +158,14 @@ def clear_cookie(self, *args, **kwargs):
158158

159159
defopen(self,*args,**kwargs):
160160
self.log.debug("Opening websocket %s",self.request.path)
161-
161+
162162
# start the pinging
163163
ifself.ping_interval>0:
164164
loop=ioloop.IOLoop.current()
165165
self.last_ping=loop.time()# Remember time of last ping
166166
self.last_pong=self.last_ping
167167
self.ping_callback=ioloop.PeriodicCallback(
168-
self.send_ping,self.ping_interval,io_loop=loop,
168+
self.send_ping,self.ping_interval,
169169
)
170170
self.ping_callback.start()
171171
returnsuper(WebSocketMixin,self).open(*args,**kwargs)
@@ -175,7 +175,7 @@ def send_ping(self):
175175
ifself.stream.closed()andself.ping_callbackisnotNone:
176176
self.ping_callback.stop()
177177
return
178-
178+
179179
# check for timeout on pong. Make sure that we really have sent a recent ping in
180180
# case the machine with both server and client has been suspended since the last ping.
181181
now=ioloop.IOLoop.current().time()

‎notebook/services/kernels/handlers.py‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -449,11 +449,8 @@ def on_close(self):
449449
forchannel,streaminself.channels.items():
450450
ifstreamisnotNoneandnotstream.closed():
451451
stream.on_recv(None)
452-
# close the socket directly, don't wait for the stream
453-
socket=stream.socket
454452
stream.close()
455-
socket.close()
456-
453+
457454
self.channels= {}
458455
self._close_future.set_result(None)
459456

‎notebook/services/kernels/kernelmanager.py‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,6 @@ def stop_buffering(self, kernel_id):
241241
forstreaminbuffer_info['channels'].values():
242242
ifnotstream.closed():
243243
stream.on_recv(None)
244-
stream.socket.close()
245244
stream.close()
246245

247246
msg_buffer=buffer_info['buffer']
@@ -386,7 +385,7 @@ def initialize_culler(self):
386385
self.cull_interval,self.cull_interval_default)
387386
self.cull_interval=self.cull_interval_default
388387
self._culler_callback=PeriodicCallback(
389-
self.cull_kernels,1000*self.cull_interval,loop)
388+
self.cull_kernels,1000*self.cull_interval)
390389
self.log.info("Culling kernels with idle durations > %s seconds at %s second intervals ...",
391390
self.cull_idle_timeout,self.cull_interval)
392391
ifself.cull_busy:

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp