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

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

Offen
#48 6 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
question
Vorherrschende Sprache
Rust
Sterne
13
Forks
5
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Rechercherichtung

Lies remote-trait-object/src/context.rs in Zeile 63 und verfolge anschließend, wie Context- und Port-Eigentümerschaft und das Herunterfahren derzeit zusammenspielen. Kläre die vorgeschlagenen Semantiken für das Herunterfahren und die Result zurückgebende API, bevor du etwas änderst; abgeschlossen ist die Arbeit, wenn das Verhalten beim Verwerfen von Context, während Ports weiterhin gehalten werden, ausdrücklich definiert und implementiert ist.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
rust
Bereich
distributed-systems
Issue-Typ
Feature
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
30/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.