MCPcopy Create free account
hub / github.com/EasyIME/PIME / split_fd

Method split_fd

python/python3/tornado/ioloop.py:766–786  ·  view source on GitHub ↗
(
        self, fd: Union[int, _Selectable]
    )

Source from the content-addressed store, hash-verified

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``.

Callers 3

add_handlerMethod · 0.80
update_handlerMethod · 0.80
remove_handlerMethod · 0.80

Calls 1

filenoMethod · 0.45

Tested by

no test coverage detected