Skip to content

Commit 97fbace

Browse files
committed
feat(go)!: rework async I/O
- Remove `Completer` abstraction and just always send async values as "pending" in Go. We may want to revisit this in the future with a better approach (e.g. encoding nested async values concurrently and using a `select` to synchronise at encoding position) - Expose `Close` for stream and future types, although for now the callers have to assert for it. This is not the final solution, just an intermediate state. More breaking changes are incoming for this functionality Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
1 parent abaef30 commit 97fbace

19 files changed

Lines changed: 559 additions & 1205 deletions

File tree

crates/wit-bindgen-go/src/interface.rs

Lines changed: 179 additions & 320 deletions
Large diffs are not rendered by default.

examples/go/hello-client/cmd/hello-client-nats/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ import (
77
"log/slog"
88
"os"
99

10+
"github.com/nats-io/nats.go"
1011
"wrpc.io/examples/go/hello-client/bindings/wrpc_examples/hello/handler"
1112
wrpcnats "wrpc.io/go/nats"
12-
"github.com/nats-io/nats.go"
1313
)
1414

1515
func run() (err error) {

examples/go/hello-server/cmd/hello-server-nats/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ import (
99
"os/signal"
1010
"syscall"
1111

12+
"github.com/nats-io/nats.go"
1213
server "wrpc.io/examples/go/hello-server/bindings"
1314
wrpcnats "wrpc.io/go/nats"
14-
"github.com/nats-io/nats.go"
1515
)
1616

1717
type Handler struct{}

examples/go/resources-server/cmd/resources-server-nats/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ import (
1010
"sync"
1111
"syscall"
1212

13+
"github.com/google/uuid"
14+
"github.com/nats-io/nats.go"
1315
server "wrpc.io/examples/go/resources-server/bindings"
1416
"wrpc.io/examples/go/resources-server/bindings/exports/wrpc_examples/resources/resources"
1517
wrpc "wrpc.io/go"
1618
wrpcnats "wrpc.io/go/nats"
17-
"github.com/google/uuid"
18-
"github.com/nats-io/nats.go"
1919
)
2020

2121
type Foo struct {

0 commit comments

Comments
 (0)