##// END OF EJS Templates
inotify: process all inotify events in one batch...
Nicolas Dumazet -
r8609:aeaa0bd9 default
parent child Browse files
Show More
@@ -500,7 +500,7 b' class repowatcher(object):'
500 evt.fullpath)
500 evt.fullpath)
501 sys.exit(0)
501 sys.exit(0)
502
502
503 def handle_pollevent(self):
503 def handle_pollevents(self, events):
504 if self.ui.debugflag:
504 if self.ui.debugflag:
505 self.ui.note(_('%s readable: %d bytes\n') %
505 self.ui.note(_('%s readable: %d bytes\n') %
506 (self.event_time(), self.threshold.readable()))
506 (self.event_time(), self.threshold.readable()))
@@ -640,6 +640,10 b' class server(object):'
640 def answer_dbug_query(self):
640 def answer_dbug_query(self):
641 return ['\0'.join(self.repowatcher.debug())]
641 return ['\0'.join(self.repowatcher.debug())]
642
642
643 def handle_pollevents(self, events):
644 for e in events:
645 self.handle_pollevent()
646
643 def handle_pollevent(self):
647 def handle_pollevent(self):
644 sock, addr = self.sock.accept()
648 sock, addr = self.sock.accept()
645
649
@@ -728,8 +732,13 b' class master(object):'
728 continue
732 continue
729 raise
733 raise
730 if events:
734 if events:
735 by_fd = {}
731 for fd, event in events:
736 for fd, event in events:
732 self.table[fd].handle_pollevent()
737 by_fd.setdefault(fd, []).append(event)
738
739 for fd, events in by_fd.iteritems():
740 self.table[fd].handle_pollevents(events)
741
733 elif timeobj:
742 elif timeobj:
734 timeobj.handle_timeout()
743 timeobj.handle_timeout()
735
744
General Comments 0
You need to be logged in to leave comments. Login now