Skip to content

[Feature Request] Advanced, unsafe ability to close the client #1202

@cretz

Description

@cretz

Describe the solution you'd like

For advanced users that need very explicitly-timed closing of TCP connections (i.e. not waiting on GC or having to run it), we should offer a way to close the client. This should probably be exposed as ServiceClient.unsafe_close() and be documented with wording like "users should not use this, and the behavior of any use of clients or things relying on clients after this call is undefined". Whether this drops the client from a Rust POV (e.g. we put it in an option and take it on close) or we add a Core method to help with this is up to the implementer/discussion.

This should also include a test (even if platform specific) that confirms the socket is closed on return from that call.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions