Skip to content

Commit e463651

Browse files
authored
Stream data in order it was received
When flushing, stream out the iterators in First in first out order. Python `pop()` with no arguments would take the last path but I think it makes sense to stream the first things first. We ran into this issue where we add a bunch of files which depend on long-running futures to provide the data. The futures hit a server which processes them roughly in order, so we get better streaming performance if we make this change.
1 parent 8dca8a2 commit e463651

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

zipstream/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ def __exit__(self, type, value, traceback):
191191

192192
def flush(self):
193193
while self.paths_to_write:
194-
kwargs = self.paths_to_write.pop()
194+
kwargs = self.paths_to_write.pop(0)
195195
for data in self.__write(**kwargs):
196196
yield data
197197

0 commit comments

Comments
 (0)