litefs.server package
- class litefs.server.BufferedRWPair(reader, writer, buffer_size=8192, /)
基类:
_BufferedIOBaseA buffered reader and writer object together.
A buffered reader object and buffered writer object put together to form a sequential IO object that can read and write. This is typically used with a socket or two-way pipe.
reader and writer are RawIOBase objects that are readable and writeable respectively. If the buffer_size is omitted it defaults to DEFAULT_BUFFER_SIZE.
- close()
Flush and close the IO object.
This method has no effect if the file is already closed.
- closed
- flush()
Flush write buffers, if applicable.
This is not implemented for read-only and non-blocking streams.
- isatty()
Return whether this is an 'interactive' stream.
Return False if it can't be determined.
- peek()
- read()
Read and return up to n bytes.
If the argument is omitted, None, or negative, reads and returns all data until EOF.
If the argument is positive, and the underlying raw stream is not 'interactive', multiple raw reads may be issued to satisfy the byte count (unless EOF is reached first). But for interactive raw streams (as well as sockets and pipes), at most one raw read will be issued, and a short result does not imply that EOF is imminent.
Returns an empty bytes object on EOF.
Returns None if the underlying raw stream was open in non-blocking mode and no data is available at the moment.
- read1()
Read and return up to n bytes, with at most one read() call to the underlying raw stream. A short result does not imply that EOF is imminent.
Returns an empty bytes object on EOF.
- readable()
Return whether object was opened for reading.
If False, read() will raise OSError.
- readinto()
- readinto1()
- writable()
Return whether object was opened for writing.
If False, write() will raise OSError.
- write()
Write the given buffer to the IO stream.
Returns the number of bytes written, which is always the length of b in bytes.
Raises BlockingIOError if the buffer is full and the underlying raw stream cannot accept more data at the moment.
- class litefs.server.HTTPServer(server_address, RequestHandlerClass, bind_and_activate=True)[源代码]
基类:
TCPServer- allow_reuse_address = 1
- max_request_size = 10485760
- class litefs.server.ProcessHTTPServer(server_address, RequestHandlerClass, bind_and_activate=True, processes=4)[源代码]
基类:
HTTPServer多进程 HTTP 服务器
- class litefs.server.SocketIO(server, sock)[源代码]
基类:
RawIOBase- close()[源代码]
Flush and close the IO object.
This method has no effect if the file is already closed.
- fileno()[源代码]
Returns underlying file descriptor if one exists.
OSError is raised if the IO object does not use a file descriptor.
- read_gr = None
- writable()[源代码]
Return whether object was opened for writing.
If False, write() will raise OSError.
- write_gr = None
- class litefs.server.TCPServer(server_address, RequestHandlerClass, bind_and_activate=True)[源代码]
基类:
objectClassic Python TCPServer
- address_family = 2
- allow_reuse_address = True
- request_queue_size = 4194304
- socket_type = 1
- class litefs.server.WSGIServer(server_address, RequestHandlerClass, bind_and_activate=True)[源代码]
基类:
HTTPServer- application = None
Submodules
litefs.server.http_server module
- class litefs.server.http_server.HTTPServer(server_address, RequestHandlerClass, bind_and_activate=True)[源代码]
基类:
TCPServer- allow_reuse_address = 1
- max_request_size = 10485760
- class litefs.server.http_server.ProcessHTTPServer(server_address, RequestHandlerClass, bind_and_activate=True, processes=4)[源代码]
基类:
HTTPServer多进程 HTTP 服务器
- class litefs.server.http_server.SocketIO(server, sock)[源代码]
基类:
RawIOBase- close()[源代码]
Flush and close the IO object.
This method has no effect if the file is already closed.
- fileno()[源代码]
Returns underlying file descriptor if one exists.
OSError is raised if the IO object does not use a file descriptor.
- read_gr = None
- writable()[源代码]
Return whether object was opened for writing.
If False, write() will raise OSError.
- write_gr = None
- class litefs.server.http_server.TCPServer(server_address, RequestHandlerClass, bind_and_activate=True)[源代码]
基类:
objectClassic Python TCPServer
- address_family = 2
- allow_reuse_address = True
- request_queue_size = 4194304
- socket_type = 1
- class litefs.server.http_server.WSGIServer(server_address, RequestHandlerClass, bind_and_activate=True)[源代码]
基类:
HTTPServer- application = None
- litefs.server.http_server.server_forever(poll_interval=0.1)