diff options
author | Inada Naoki <songofacandy@gmail.com> | 2020-02-06 20:29:33 +0900 |
---|---|---|
committer | Inada Naoki <songofacandy@gmail.com> | 2020-02-06 20:29:33 +0900 |
commit | 24950990f4ebeffbf98acd188b171cc60a27095e (patch) | |
tree | 2980ad9459d0dfc0cba8c922809be9792b7108af | |
parent | 1bd6fc36d09cea273a5b47d4f54ed5e3b718582c (diff) | |
download | msgpack-python-24950990f4ebeffbf98acd188b171cc60a27095e.tar.gz |
Remove broken example
-rw-r--r-- | README.md | 18 |
1 files changed, 0 insertions, 18 deletions
@@ -214,24 +214,6 @@ the result, or ignoring it. The latter two methods return the number of elements in the upcoming container, so that each element in an array, or key-value pair in a map, can be unpacked or skipped individually. -Each of these methods may optionally write the packed data it reads to a -callback function: - -```py - from io import BytesIO - - def distribute(unpacker, get_worker): - nelems = unpacker.read_map_header() - for i in range(nelems): - # Select a worker for the given key - key = unpacker.unpack() - worker = get_worker(key) - - # Send the value as a packed message to worker - bytestream = BytesIO() - unpacker.skip(bytestream.write) - worker.send(bytestream.getvalue()) -``` ## Notes |