Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Problem with `timed_window` with asyncio

Open
#131 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
python

Research direction

Start with the fib_asyncio.py example and the sync function in streamz/core.py around line 1068, then reproduce the timed_window failure with asyncio. Trace how the event loop is checked and verify that the example runs without the reported AttributeError.

Written by the indexing model from the issue text.

Description

Hi,

When I try to use the timed_window function with the asyncio event loop I get the following error:

AttributeError: 'AsyncIOMainLoop' object has no attribute '_running'

For example if you change line 12 of the `fib_asyncio.py" example to:

s.timed_window(1.0).sink(lambda x: print(x))

then I get:

$ python fib_asyncio.py
Traceback (most recent call last):
  File "fib_asyncio.py", line 14, in <module>
    source.emit(0)                          # seed with initial values
  File "/opt/venv-numismatic/lib/python3.6/site-packages/streamz/core.py", line 219, in emit
    return sync(self.loop, _)
  File "/opt/venv-numismatic/lib/python3.6/site-packages/streamz/core.py", line 1068, in sync
    if not loop._running:
AttributeError: 'AsyncIOMainLoop' object has no attribute '_running'

Dominant language
Python
Stars
1.3k
Forks
149
Avg merge
17h 39m
Merged PRs (30d)
1

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from python-streamz/streamz

All issues in python-streamz/streamz

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.