distributed 2021.10.0

BackRef
register_generic(cls, serializer_name='dask', serialize_func=<dask.utils.Dispatch object at 0x0000000>, deserialize_func=<dask.utils.Dispatch object at 0x0000000>)

Normally when registering new classes for Dask's custom serialization you need to manage headers and frames, which can be tedious. If all you want to do is traverse through your object and apply serialize to all of your object's attributes then this function may provide an easier path.

This registers a class for the custom Dask serialization family. It serializes it by traversing through its __dict__ of attributes and applying serialize and deserialize recursively. It collects a set of frames and keeps small attributes in the header. Deserialization reverses this process.

This is a good idea if the following hold:

  1. Most of the bytes of your object are composed of data types that Dask's custom serializtion already handles well, like Numpy arrays.

  2. Your object doesn't require any special constructor logic, other than object.__new__(cls)

Register (de)serialize to traverse through __dict__

See Also

dask_deserialize
dask_serialize

Examples

This example is valid syntax, but we were not able to check execution
>>> import sklearn.base
... from distributed.protocol import register_generic
... register_generic(sklearn.base.BaseEstimator)
See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

distributed.protocol.serialize.register_generic

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


File: /distributed/protocol/serialize.py#810
type: <class 'function'>
Commit: