Skip to content

Conversation

@rvolosatovs
Copy link
Member

@rvolosatovs rvolosatovs commented Sep 27, 2024

Encoding/decoding nested futures (e.g. future<future<T>>) (inconsistently) indexed the inner future with an index of 0.
For future<future<T>> sent at path x, inner, pending, future element would have been sent on x.0.
For example:
pending(pending(true)) would be sent as:
x: 0x00, 0x00
x.0: 0x01

WIth this PR:
x: 0x00, 0x00, 0x01

This ensures the implementation is consistent with other types (e.g. results or options) and provides greater optimization opportunities (e.g. client-side data batching)

With the above behavior fixed and made consistent across Go and Rust, this also closes #266, which caused leaking subscriptions in Go using async. If not explicitly type-asserted for io.Closer and Close'd, the subscriptions will be closed using runtime finalizers

Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
@rvolosatovs rvolosatovs changed the title fix(go,rs): nested future support fix(go,rs): nested async support Sep 27, 2024
Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
@rvolosatovs rvolosatovs force-pushed the feat/go-nats-unsub branch 2 times, most recently from 0ca81d7 to 024ce22 Compare September 30, 2024 18:33
Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
@rvolosatovs rvolosatovs marked this pull request as ready for review October 1, 2024 07:52
Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
@rvolosatovs rvolosatovs enabled auto-merge October 1, 2024 08:15
@rvolosatovs rvolosatovs disabled auto-merge October 1, 2024 08:17
Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
@rvolosatovs rvolosatovs enabled auto-merge October 1, 2024 08:28
@rvolosatovs rvolosatovs added this pull request to the merge queue Oct 1, 2024
Merged via the queue into bytecodealliance:main with commit 9a77e88 Oct 1, 2024
@rvolosatovs rvolosatovs deleted the feat/go-nats-unsub branch October 1, 2024 08:46
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.

[go] nested NATS stream lifetime

1 participant