(
self, fd: Union[int, _Selectable]
)
| 782 | future.result() |
| 783 | |
| 784 | def split_fd( |
| 785 | self, fd: Union[int, _Selectable] |
| 786 | ) -> Tuple[int, Union[int, _Selectable]]: |
| 787 | # """Returns an (fd, obj) pair from an ``fd`` parameter. |
| 788 | |
| 789 | # We accept both raw file descriptors and file-like objects as |
| 790 | # input to `add_handler` and related methods. When a file-like |
| 791 | # object is passed, we must retain the object itself so we can |
| 792 | # close it correctly when the `IOLoop` shuts down, but the |
| 793 | # poller interfaces favor file descriptors (they will accept |
| 794 | # file-like objects and call ``fileno()`` for you, but they |
| 795 | # always return the descriptor itself). |
| 796 | |
| 797 | # This method is provided for use by `IOLoop` subclasses and should |
| 798 | # not generally be used by application code. |
| 799 | |
| 800 | # .. versionadded:: 4.0 |
| 801 | # """ |
| 802 | if isinstance(fd, int): |
| 803 | return fd, fd |
| 804 | return fd.fileno(), fd |
| 805 | |
| 806 | def close_fd(self, fd: Union[int, _Selectable]) -> None: |
| 807 | # """Utility method to close an ``fd``. |
no test coverage detected