iterate_file_descriptors_safely
Apply hub method to fds in iter, remove from list if failure.
def iterate_file_descriptors_safely(
fds_iter: iterable,
source_data: list|set|dict,
hub_method: callable,
*args: any,
**kwargs: any
) - > null
Apply hub method to fds in iter, remove from list if failure. Some file descriptors may become stale through OS reasons or possibly other reasons, so safely manage our lists of FDs.
Parameters
| Name | Type | Description |
|---|---|---|
| fds_iter | iterable | The collection of file descriptors to iterate over and process using the hub_method. |
| source_data | `list | set |
| hub_method | callable | The function or method to execute for each file descriptor in the iteration. |
| *args | any | Positional arguments passed to the hub_method; the string 'fd' acts as a placeholder that is replaced by the current file descriptor object during execution. |
| **kwargs | any | Keyword arguments passed directly to the hub_method without substitution. |
Returns
| Type | Description |
|---|---|
null | This function does not return a value; it modifies the source_data collection in-place. |