Parallel streams with buffers
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Cần làm rõ
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- python
- Lĩnh vực
- stream-processing
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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?
- Ngôn ngữ chính
- Python
- Star
- 1.3k
- Fork
- 149
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của python-streamz/streamz
-
pkg_resources warning Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
python-streamz/streamz#481 · 4 bình luận ·
-
Combining the streamz.Stream.filenames() and streamz.Stream.from_textfile() using dask scatter? Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
python-streamz/streamz#480 · 2 bình luận ·
-
Compile the code into c++ Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 20/100
python-streamz/streamz#479 · 1 bình luận ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 20/100
python-streamz/streamz#478 · 6 bình luận ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 10/100
python-streamz/streamz#476 · 17 bình luận · 2 reaction ·
Tất cả issue của python-streamz/streamz
Issue tương tự
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
use-agent-os/agent-os#3314 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
BasedHardware/omi#15662 · 1 bình luận ·
-
documentation help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 90/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
AiursoftWeb/AnduinOS-2#19 ·