(
self, fd: Union[int, _Selectable]
)
| 764 | future.result() |
| 765 | |
| 766 | def split_fd( |
| 767 | self, fd: Union[int, _Selectable] |
| 768 | ) -> Tuple[int, Union[int, _Selectable]]: |
| 769 | # """Returns an (fd, obj) pair from an ``fd`` parameter. |
| 770 | |
| 771 | # We accept both raw file descriptors and file-like objects as |
| 772 | # input to `add_handler` and related methods. When a file-like |
| 773 | # object is passed, we must retain the object itself so we can |
| 774 | # close it correctly when the `IOLoop` shuts down, but the |
| 775 | # poller interfaces favor file descriptors (they will accept |
| 776 | # file-like objects and call ``fileno()`` for you, but they |
| 777 | # always return the descriptor itself). |
| 778 | |
| 779 | # This method is provided for use by `IOLoop` subclasses and should |
| 780 | # not generally be used by application code. |
| 781 | |
| 782 | # .. versionadded:: 4.0 |
| 783 | # """ |
| 784 | if isinstance(fd, int): |
| 785 | return fd, fd |
| 786 | return fd.fileno(), fd |
| 787 | |
| 788 | def close_fd(self, fd: Union[int, _Selectable]) -> None: |
| 789 | # """Utility method to close an ``fd``. |
no test coverage detected