Skip to content

Switch to sansio websockets back-end#289

Open
rwb27 wants to merge 1 commit intomainfrom
websockets-sansio
Open

Switch to sansio websockets back-end#289
rwb27 wants to merge 1 commit intomainfrom
websockets-sansio

Conversation

@rwb27
Copy link
Collaborator

@rwb27 rwb27 commented Mar 5, 2026

Uvicorn uses the now deprecated websockets.legacy back end by default. It also supports the newer sansio interface. As far as I can tell, either works, so I'm not sure why legacy is the default: backwards compatibility I guess.

I'd like to switch to the newer implementation now, before we are using websockets in anger, as it feels wrong to start out with deprecation warnings in the test suite! I don't believe we will notice the difference, but hopefully the test suite will tell. Websockets aren't used yet by the OFM.

Uvicorn uses the now deprecated `websockets.legacy` back end by default. It also supports the newer `sansio` interface. As far as I can tell, either works, so I'm not sure why legacy is the default: backwards compatibility I guess.

I'd like to switch to the newer implementation now, before we are using websockets in anger, as it feels wrong to start out with deprecation warnings in the test suite!
@barecheck
Copy link

barecheck bot commented Mar 5, 2026

Barecheck - Code coverage report

Total: 96.34%

Your code coverage diff: 0.00% ▴

Uncovered files and lines
FileLines
src/labthings_fastapi/server/cli.py102, 184

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