mirror of
https://github.com/msgpack/msgpack-python.git
synced 2026-02-06 17:59:52 +00:00
Remove broken example
This commit is contained in:
parent
1bd6fc36d0
commit
24950990f4
1 changed files with 0 additions and 18 deletions
18
README.md
18
README.md
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue