Skip to content

Commit ef94a77

Browse files
committed
touch up
1 parent c915047 commit ef94a77

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

docs/guides/CHAPTER-3.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -97,26 +97,26 @@ The following sample code demonstrates this use case.
9797
```python
9898
from mercury.system.objstream import ObjectStreamIO
9999
# create a new stream with 60 seconds inactivity expiry
100-
out = ObjectStreamIO(expiry_seconds=60)
101-
out.write('hello world 1')
102-
out.write('hello world 2')
100+
producer = ObjectStreamIO(expiry_seconds=60)
101+
producer.write('hello world 1')
102+
producer.write('hello world 2')
103103
# signal EOF so the input stream generator will finish
104-
out.send_eof()
104+
producer.send_eof()
105105

106106
# the producer should obtain the stream_id and send it to the consumer
107-
stream_id = out.get_route()
107+
stream_id = producer.get_route()
108108

109109
# the consumer will open the existing stream with the stream_id
110-
in = ObjectStreamIO(route=stream_id, expiry_seconds=60)
110+
consumer = ObjectStreamIO(route=stream_id, expiry_seconds=60)
111111
try:
112112
# set a 10 seconds read timeout for the input stream generator
113-
for i in in.read(10):
113+
for i in consumer.read(10):
114114
print(i)
115115
except TimeoutError as te:
116116
# you may retry reading from the generator again if you want to wait for more input
117117

118118
# close and release the stream
119-
in.close()
119+
consumer.close()
120120
```
121121

122122
### Broadcast

0 commit comments

Comments
 (0)