DiamondLightSource / DiamondLightSource/fastcs

[ophyd-async] Reconnect via connect(force_reconnect=True) + atexit shutdown

Open
#401 0 comments 0 reactions 0 assignees View on GitHub
api-convergence
Dominant language
Python
Stars
6
Forks
8
Avg merge
2d 12h
Merged PRs (30d)
3

Description

**Rewritten** — the `Device.disconnect()` proposal is dropped (0019 L168).

## Scope
- Reconnect = `Device.connect(force_reconnect=True)`. The only disconnect we want is **atexit**, so the connector registers an atexit hook (Giles: "atexit is fine") plus explicit `await connector.shutdown()`.
- `ControllerRunner` (#395) owns lifecycle incl. reconnect, so the connector defers to it.
- (Optional/out-of-scope-first-cut) serve-transports-alongside-embed (decision 9): design the runner so a transport list can be added later — no work required here beyond not precluding it.

## Acceptance
`uv run --locked tox -e pre-commit,type-checking,tests` green.

ADR: 0019
Parent: #388
Blocked by: #399

Contributor guide

Open the contributing guide

Research direction

Start with ADR 0019 and the lifecycle described for ControllerRunner in #395, then inspect the connector and Device.connect entry points. Check the dependency on #399 before starting. Done means force_reconnect=True works, atexit and explicit connector shutdown are handled, and uv run --locked tox -e pre-commit,type-checking,tests is green.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.