# EventSource

> **Class** in `deepagents_code`

📖 [View in docs](https://reference.langchain.com/python/deepagents-code/event_bus/EventSource)

Source of external events for the Textual app.

Implementations must be safe to `stop()` even when `start()` failed
partway through; the app always invokes `stop()` from a `finally` block.

## Signature

```python
EventSource()
```

## Extends

- `Protocol`

## Methods

- [`start()`](https://reference.langchain.com/python/deepagents-code/event_bus/EventSource/start)
- [`serve_forever()`](https://reference.langchain.com/python/deepagents-code/event_bus/EventSource/serve_forever)
- [`stop()`](https://reference.langchain.com/python/deepagents-code/event_bus/EventSource/stop)

---

[View source on GitHub](https://github.com/langchain-ai/deepagents/blob/a98f0dfa8d534d8a1885b524632400e52db22ac6/libs/code/deepagents_code/event_bus.py#L87)