An implementation of JSON serialization

Implementation of the serialization layer is easier than framing because it always emits one item when one item is received. So any serialization algorithm can be used with the map operator. As for JSON, Python already provides serialization and deserialization functions for this. So the deserialization part is just an additional map in an operator chain, as can be seen in the following example:

.map(lambda i: json.loads(i))

The serialization part is also shown in the following example:

.map(lambda i: json.dumps(i))
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.189.171.153