MCPcopy Index your code
hub / github.com/pathwaycom/pathway / FileStreamSubject

Class FileStreamSubject

python/pathway/demo/__init__.py:88–105  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

86 )
87
88 class FileStreamSubject(pw.io.python.ConnectorSubject):
89 def run(self):
90 def _get_row(i):
91 row = {}
92 for name, fun in value_generators.items():
93 row[name] = fun(i)
94 return row
95
96 if nb_rows is None:
97 row_index = 0
98 while True:
99 self.next_json(_get_row(row_index))
100 row_index = row_index + 1
101 time.sleep(1.0 / input_rate)
102 else:
103 for row_index in range(nb_rows):
104 self.next_json(_get_row(row_index))
105 time.sleep(1.0 / input_rate)
106
107 table = pw.io.python.read(
108 FileStreamSubject(datasource_name="demo.custom-stream"),

Callers 3

generate_custom_streamFunction · 0.85
replay_csvFunction · 0.85
replay_csv_with_timeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected