Process state storage for residual file descriptors.
ports manages the set of file descriptors that are intended to be kept across process images. This module is normally used exclusively by daemon processes that wish to update their process image without having to discard listening sockets.
os
typing
kernel
_state
_state = {}
close
close(identifier)
Close the ports associated with the identifier and remove them from storage.
restoreNone
restore(identifier, ports)
Add ports to the set using the identifier presuming that the ports are properly configured. Used by daemon processes after performing exec to refresh the process image.
installNone
install(identifier, ports)
Add the ports to the set making sure that they are properly configured to persist across process images.
If a sequence of ports is already installed with the identifier, it will be extended.
allocatetyping.Mapping[str, kernel.Ports]
allocate()
Return the full set of installed ports for use within a worker process and remove the installed ports from process the global data.