π FileMgr
π
/
lib64
/
python3.9
/
asyncio
/
__pycache__
βοΈ /
β¬ Kembali
a οΏ½i- οΏ½ @ sb d Z dZG ddοΏ½ dοΏ½ZG ddοΏ½ deοΏ½ZG ddοΏ½ deοΏ½ZG dd οΏ½ d eοΏ½ZG d dοΏ½ deοΏ½Zdd οΏ½ ZdS )zAbstract Protocol base classes.)οΏ½BaseProtocolοΏ½ProtocolοΏ½DatagramProtocolοΏ½SubprocessProtocolοΏ½BufferedProtocolc @ s4 e Zd ZdZdZddοΏ½ ZddοΏ½ ZddοΏ½ Zd d οΏ½ ZdS )r a Common base class for protocol interfaces. Usually user implements protocols that derived from BaseProtocol like Protocol or ProcessProtocol. The only case when BaseProtocol should be implemented directly is write-only transport like write pipe οΏ½ c C s dS )zοΏ½Called when a connection is made. The argument is the transport representing the pipe connection. To receive data, wait for data_received() calls. When the connection is closed, connection_lost() is called. Nr )οΏ½selfZ transportr r οΏ½)/usr/lib64/python3.9/asyncio/protocols.pyοΏ½connection_made s zBaseProtocol.connection_madec C s dS )zοΏ½Called when the connection is lost or closed. The argument is an exception object or None (the latter meaning a regular EOF is received or the connection was aborted or closed). Nr οΏ½r οΏ½excr r r οΏ½connection_lost s zBaseProtocol.connection_lostc C s dS )a Called when the transport's buffer goes over the high-water mark. Pause and resume calls are paired -- pause_writing() is called once when the buffer goes strictly over the high-water mark (even if subsequent writes increases the buffer size even more), and eventually resume_writing() is called once when the buffer size reaches the low-water mark. Note that if the buffer size equals the high-water mark, pause_writing() is not called -- it must go strictly over. Conversely, resume_writing() is called when the buffer size is equal or lower than the low-water mark. These end conditions are important to ensure that things go as expected when either mark is zero. NOTE: This is the only Protocol callback that is not called through EventLoop.call_soon() -- if it were, it would have no effect when it's most needed (when the app keeps writing without yielding until pause_writing() is called). Nr οΏ½r r r r οΏ½ pause_writing% s zBaseProtocol.pause_writingc C s dS )zvCalled when the transport's buffer drains below the low-water mark. See pause_writing() for details. Nr r r r r οΏ½resume_writing; s zBaseProtocol.resume_writingN) οΏ½__name__οΏ½ __module__οΏ½__qualname__οΏ½__doc__οΏ½ __slots__r r r r r r r r r s r c @ s$ e Zd ZdZdZddοΏ½ ZddοΏ½ ZdS )r an Interface for stream protocol. The user should implement this interface. They can inherit from this class but don't need to. The implementations here do nothing (they don't raise exceptions). When the user wants to requests a transport, they pass a protocol factory to a utility function (e.g., EventLoop.create_connection()). When the connection is made successfully, connection_made() is called with a suitable transport object. Then data_received() will be called 0 or more times with data (bytes) received from the transport; finally, connection_lost() will be called exactly once with either an exception object or None as an argument. State machine of calls: start -> CM [-> DR*] [-> ER?] -> CL -> end * CM: connection_made() * DR: data_received() * ER: eof_received() * CL: connection_lost() r c C s dS )zTCalled when some data is received. The argument is a bytes object. Nr )r οΏ½datar r r οΏ½ data_received^ s zProtocol.data_receivedc C s dS οΏ½zοΏ½Called when the other end calls write_eof() or equivalent. If this returns a false value (including None), the transport will close itself. If it returns a true value, closing the transport is up to the protocol. Nr r r r r οΏ½eof_receivedd s zProtocol.eof_receivedN)r r r r r r r r r r r r B s r c @ s, e Zd ZdZdZddοΏ½ ZddοΏ½ ZddοΏ½ Zd S ) r a: Interface for stream protocol with manual buffer control. Event methods, such as `create_server` and `create_connection`, accept factories that return protocols that implement this interface. The idea of BufferedProtocol is that it allows to manually allocate and control the receive buffer. Event loops can then use the buffer provided by the protocol to avoid unnecessary data copies. This can result in noticeable performance improvement for protocols that receive big amounts of data. Sophisticated protocols can allocate the buffer only once at creation time. State machine of calls: start -> CM [-> GB [-> BU?]]* [-> ER?] -> CL -> end * CM: connection_made() * GB: get_buffer() * BU: buffer_updated() * ER: eof_received() * CL: connection_lost() r c C s dS )aP Called to allocate a new receive buffer. *sizehint* is a recommended minimal size for the returned buffer. When set to -1, the buffer size can be arbitrary. Must return an object that implements the :ref:`buffer protocol <bufferobjects>`. It is an error to return a zero-sized buffer. Nr )r οΏ½sizehintr r r οΏ½ get_bufferοΏ½ s zBufferedProtocol.get_bufferc C s dS )zοΏ½Called when the buffer was updated with the received data. *nbytes* is the total number of bytes that were written to the buffer. Nr )r οΏ½nbytesr r r οΏ½buffer_updatedοΏ½ s zBufferedProtocol.buffer_updatedc C s dS r r r r r r r οΏ½ s zBufferedProtocol.eof_receivedN)r r r r r r r r r r r r r m s r c @ s$ e Zd ZdZdZddοΏ½ ZddοΏ½ ZdS )r z Interface for datagram protocol.r c C s dS )z&Called when some datagram is received.Nr )r r οΏ½addrr r r οΏ½datagram_receivedοΏ½ s z"DatagramProtocol.datagram_receivedc C s dS )z~Called when a send or receive operation raises an OSError. (Other than BlockingIOError or InterruptedError.) Nr r r r r οΏ½error_receivedοΏ½ s zDatagramProtocol.error_receivedN)r r r r r r r r r r r r οΏ½ s r c @ s, e Zd ZdZdZddοΏ½ ZddοΏ½ ZddοΏ½ Zd S ) r z,Interface for protocol for subprocess calls.r c C s dS )zοΏ½Called when the subprocess writes data into stdout/stderr pipe. fd is int file descriptor. data is bytes object. Nr )r οΏ½fdr r r r οΏ½pipe_data_receivedοΏ½ s z%SubprocessProtocol.pipe_data_receivedc C s dS )zοΏ½Called when a file descriptor associated with the child process is closed. fd is the int file descriptor that was closed. Nr )r r r r r r οΏ½pipe_connection_lostοΏ½ s z'SubprocessProtocol.pipe_connection_lostc C s dS )z"Called when subprocess has exited.Nr r r r r οΏ½process_exitedοΏ½ s z!SubprocessProtocol.process_exitedN)r r r r r r! r"