specta-rs / rspc

A framework for building typesafe web backends in Rust
https://rspc.dev
MIT License
1.19k stars 54 forks source link

close websocket handle in client #307

Open StoicDeveloper opened 2 months ago

StoicDeveloper commented 2 months ago

Ideally, the websocket could be closed both explicitly, with a client.close() method, and implicitly when the client goes out of scope. The current implementation causes an issue in jest integration tests where a test that uses WebsocketTransport will hang forever, or until the websocket times out, and there is no way to close the socket, since the client.transport.ws field is private.

StoicDeveloper commented 2 months ago

If you think this is a good idea, I'd be happy to submit a PR