##// END OF EJS Templates
commandserver: use selectors2...
Jun Wu -
r33503:27d23fe3 default
parent child Browse files
Show More
@@ -22,6 +22,7 b' from . import ('
22 encoding,
22 encoding,
23 error,
23 error,
24 pycompat,
24 pycompat,
25 selectors2,
25 util,
26 util,
26 )
27 )
27
28
@@ -476,6 +477,8 b' class unixforkingservice(object):'
476 def _mainloop(self):
477 def _mainloop(self):
477 exiting = False
478 exiting = False
478 h = self._servicehandler
479 h = self._servicehandler
480 selector = selectors2.DefaultSelector()
481 selector.register(self._sock, selectors2.EVENT_READ)
479 while True:
482 while True:
480 if not exiting and h.shouldexit():
483 if not exiting and h.shouldexit():
481 # clients can no longer connect() to the domain socket, so
484 # clients can no longer connect() to the domain socket, so
@@ -486,7 +489,7 b' class unixforkingservice(object):'
486 self._unlinksocket()
489 self._unlinksocket()
487 exiting = True
490 exiting = True
488 try:
491 try:
489 ready = select.select([self._sock], [], [], h.pollinterval)[0]
492 ready = selector.select(timeout=h.pollinterval)
490 if not ready:
493 if not ready:
491 # only exit if we completed all queued requests
494 # only exit if we completed all queued requests
492 if exiting:
495 if exiting:
General Comments 0
You need to be logged in to leave comments. Login now