We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b382a65 commit f16b464Copy full SHA for f16b464
examples/network_wordcount.py
@@ -2,23 +2,20 @@
2
""" a recreation of spark-streaming's network_wordcount
3
4
https://spark.apache.org/docs/2.2.0/streaming-programming-guide.html#a-quick-example
5
-
6
-Run this within an interactive session, or with
7
-> python -i -network_wordcount.py
8
-so that python won't exit before producing output.
9
"""
10
+import time
11
from streamz import Stream
12
13
# absolute port on localhost for now
14
s = Stream.from_tcp(9999)
15
s.map(bytes.split).flatten().frequencies().sink(print)
16
17
print(
18
- """In another terminal executs
+ """In another terminal execute
19
> nc 127.0.0.1 9999
20
and then start typing content
21
22
)
23
24
s.start()
+time.sleep(600)
0 commit comments