| 703 | return f |
| 704 | |
| 705 | def _register_with_iocp(self, obj): |
| 706 | # To get notifications of finished ops on this objects sent to the |
| 707 | # completion port, were must register the handle. |
| 708 | if obj not in self._registered: |
| 709 | self._registered.add(obj) |
| 710 | _overlapped.CreateIoCompletionPort(obj.fileno(), self._iocp, 0, 0) |
| 711 | # XXX We could also use SetFileCompletionNotificationModes() |
| 712 | # to avoid sending notifications to completion port of ops |
| 713 | # that succeed immediately. |
| 714 | |
| 715 | def _register(self, ov, obj, callback): |
| 716 | self._check_closed() |