# RuntimeError: Event loop is closed: call_soon() cannot be called

- **ID:** `python/asyncio-event-loop-call-later-error`
- **Domain:** python
- **Category:** runtime_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

A callback is scheduled on an event loop that has already been closed, often after asyncio.run() finishes.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 3.9 | active | — | — |
| 3.10 | active | — | — |

## Workarounds

1. **Ensure all callbacks are scheduled before the loop closes** (85% success)
   ```
   loop = asyncio.get_running_loop()
loop.call_soon(some_callback)
# ensure loop is still running
   ```
2. **Use asyncio.get_running_loop() to check if loop is active** (90% success)
   ```
   try:
    loop = asyncio.get_running_loop()
    loop.call_soon(callback)
except RuntimeError:
    # loop not running, handle accordingly
   ```

## Dead Ends

- **Using asyncio.get_event_loop() to get a new loop** — If the loop is closed, get_event_loop() may raise an error or return a closed loop. (60% fail)
- **Ignoring the error and assuming the callback ran** — The callback never executes, leading to incomplete operations. (50% fail)
