Parallel streams with buffers
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Necesita aclaración
- Estado de actividad
- Estancado
- Stack tecnológico
- python
- Área
- stream-processing
Línea de trabajo
Start with the provided Stream(asynchronous=True) example and trace how map, buffer, and sink schedule their work. Compare the stream's behavior with the stated 30-second runtime and expected 21-second runtime; done means the issue's intended parallel download and processing behavior is clearly established, including whether Dask is appropriate.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
In a simple use case like downloading files and process them on a single machine, how could one achieve parallelization of downloads and processes with buffers?
Example:
import time
from streamz import Stream
from tornado.ioloop import IOLoop
def download_file(file_id: int):
time.sleep(1)
print(f"Downloaded file: {file_id}")
return file_id
def process_file(file_id: int):
time.sleep(2)
print(f"Processed file : {file_id}")
return file_id
async def streamz_run():
s = Stream(asynchronous=True)
s.map(download_file).buffer(4).sink(process_file)
for i in range(10):
await s.emit(i)
if __name__ == '__main__':
start = time.time()
IOLoop().run_sync(streamz_run)
print(f"Streamz run took: {time.time() - start}s")
The download_file is properly buffered but not executed at the same time as process_file. The whole thing takes ~30s to run while we could expect 21s with parallel downloads/processes. Is using Dask the intended way in that case?
- Lenguaje dominante
- Python
- Estrellas
- 1.3k
- Forks
- 149
- Merge medio
- 17 h 39 min
- PR fusionados (30 d)
- 1
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de python-streamz/streamz
-
pkg_resources warning Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 35/100
python-streamz/streamz#481 · 4 comentarios ·
-
Combining the streamz.Stream.filenames() and streamz.Stream.from_textfile() using dask scatter? Abierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
python-streamz/streamz#480 · 2 comentarios ·
-
Compile the code into c++ Abierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 20/100
python-streamz/streamz#479 · 1 comentario ·
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 20/100
python-streamz/streamz#478 · 6 comentarios ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 10/100
python-streamz/streamz#476 · 17 comentarios · 2 reacciones ·
Todos los issues de python-streamz/streamz
Issues similares
-
[Bug] reef-hermes tells me to resume with hermes --resume, which does not work from my shell Abiertoarea: harness bug status: needs-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Human-Agent-Society/reef#625 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 80/100
learningequality/kolibri#15351 · 2 comentarios ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
-
Name consistency Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
eellak/triplestore#65 · 1 comentario ·