nvflare.fuel.utils.fobs.datum module
- class Datum(datum_type: DatumType, value: Any, dot=0)[source]
Bases:
objectDatum is a class that holds information for externalized data
Constructor of Datum object
- Parameters:
datum_type – type of the datum.
value – value of the datum
dot – the Object Type of the datum
- class DatumManager(threshold=None, fobs_ctx: dict | None = None)[source]
Bases:
object- get_fobs_context()[source]
Get the FOBS Context associated with the manager. The context is available during the whole process of serialization/deserialization of a single message. Since Decomposers are singleton objects that could be used by multiple decomposition processes concurrently, processing state data must not be stored in the decomposer! Instead, such data should be stored in the FOBS context.
Returns:
- post_process()[source]
Invoke all post serialization callbacks. Called during serialization after all objects are decomposed.
Returns: None
- register_post_cb(cb: Callable[[DatumManager], None], **cb_kwargs)[source]
Register a callback that will be called after the decomposition is done during serialization process. The callback is typically registered during decomposition by decomposers.
Note that the callback itself could also call this method to register additional callbacks. These callbacks will be appended to the callback list.
The manager’s post CB processing continues until all registered callbacks are invoked.
- Parameters:
cb – the callback to be registered
**cb_kwargs – kwargs to be passed to the callback when invoked
Returns: