Skip to content

Work inside Jupyter's running event loop (#55) - #87

Merged
soodoku merged 1 commit into
masterfrom
jupyter-event-loop
Oct 23, 2026
Merged

soodoku merged 1 commit into
masterfrom
jupyter-event-loop

Conversation

@soodoku

@soodoku soodoku commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

Every Match / Summary call failed in Jupyter with RuntimeError: asyncio.run() cannot be called from a running event loop. When a loop is already running, the Playwright fetch now runs on a worker thread with its own loop.

Verified with an executed notebook (jupyter nbconvert --execute): before, both cells raised the error; after, they print 225 matches and IND Women won by 17 runs. Unit test covers the running-loop path.

Refs #55

🤖 Generated with Claude Code

Jupyter runs an asyncio loop, and asyncio.run() refuses to nest inside
it, so every Match and Summary call failed in notebooks. Run the fetch on
a worker thread with its own loop when one is already running. Verified
by executing a real notebook (both cells failed before, pass after).

Refs #55

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@soodoku
soodoku enabled auto-merge (squash) October 23, 2026 20:31
@soodoku
soodoku merged commit 45ac89d into master Oct 23, 2026
12 checks passed
@soodoku
soodoku deleted the jupyter-event-loop branch October 23, 2026 20:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant