File tree Expand file tree Collapse file tree 3 files changed +6
-6
lines changed
Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Original file line number Diff line number Diff line change 66s = source .sliding_window (2 ).map (sum )
77L = s .sink_to_list () # store result in a list
88
9- s .rate_limit ('500ms' ).sink (source .emit ) # pipe output back to input
109s .rate_limit ('1s' ).sink (lambda x : print (L )) # print state of L every second
10+ s .rate_limit ('500ms' ).connect (source ) # pipe output back to input
1111
12- source .emit (1 ) # seed with initial values , does not block thread due to Future return
12+ source .emit (1 ) # seed with initial value , does not block thread due to Future return
1313
1414try :
1515 asyncio .get_event_loop ().run_forever ()
Original file line number Diff line number Diff line change 44s = source .sliding_window (2 ).map (sum )
55L = s .sink_to_list () # store result in a list
66
7- s .rate_limit ('500ms' ).sink (source .emit ) # pipe output back to input
87s .rate_limit ('1s' ).sink (lambda x : print (L )) # print state of L every second
8+ s .rate_limit ('500ms' ).connect (source ) # pipe output back to input
99
1010try :
11- source .emit (1 ) # seed with initial values , blocks thread due to cycle in stream
11+ source .emit (1 ) # seed with initial value , blocks thread due to cycle in stream
1212except KeyboardInterrupt :
1313 pass
Original file line number Diff line number Diff line change 66s = source .sliding_window (2 ).map (sum )
77L = s .sink_to_list () # store result in a list
88
9- s .rate_limit ('500ms' ).sink (source .emit ) # pipe output back to input
109s .rate_limit ('1s' ).sink (lambda x : print (L )) # print state of L every second
10+ s .rate_limit ('500ms' ).connect (source ) # pipe output back to input
1111
12- source .emit (1 ) # seed with initial values , does not block thread due to Future return
12+ source .emit (1 ) # seed with initial value , does not block thread due to Future return
1313
1414try :
1515 IOLoop .current ().start ()
You can’t perform that action at this time.
0 commit comments