CodeChain-io / CodeChain-io/remote-trait-object

Why the port must be dropped when the context is dropped?

Open
#48 6 comments 0 reactions 0 assignees View on GitHub
question
Dominant language
Rust
Stars
13
Forks
5
PR merge metrics
No merged PRs in 30d

Description

https://github.com/CodeChain-io/remote-trait-object/blob/7ac07c741059ae583a05143a62cd6b07898e1c0b/remote-trait-object/src/context.rs#L63

Currently, it fails to drop the context when the port is still held by others. But, there is no way to guarantee whether all other holders released before the context dropped.
How about dropping context calls shutdown and making the methods of the `Port` returns a `Result`?
It also should make the shutdown of the `Port` takes the mutable reference of the self. It means the user can access the port after shutdown, but I think this would be safer.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.