gevent.os – This module provides cooperative versions of os.read() and os.write()

This module provides cooperative versions of os.read() and os.write(). On Posix platforms this uses non-blocking IO, on Windows a threadpool is used.

gevent.os.fork()
gevent.os.tp_read(fd, n)

Read up to n bytes from file descriptor fd. Return a string containing the bytes read. If end-of-file is reached, an empty string is returned.

gevent.os.tp_write(fd, buf)

Write bytes from buffer buf to file descriptor fd. Return the number of bytes written.

gevent.os.make_nonblocking(fd)
gevent.os.nb_read(fd, n)

Read up to n bytes from file descriptor fd. Return a string containing the bytes read. If end-of-file is reached, an empty string is returned.

The descriptor must be in non-blocking mode.

gevent.os.nb_write(fd, buf)

Write bytes from buffer buf to file descriptor fd. Return the number of bytes written.

The file descriptor must be in non-blocking mode.