# 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/3812967c84d90619848f3185f22470204fc88bd8/libs/code/deepagents_code/event_bus.py#L87)