Skip to content

Commit

Permalink
feat(go)!: rework async I/O
Browse files Browse the repository at this point in the history
- 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 <[email protected]>
  • Loading branch information
rvolosatovs committed Aug 26, 2024
1 parent abaef30 commit 5ba49b1
Show file tree
Hide file tree
Showing 19 changed files with 559 additions and 1,205 deletions.
499 changes: 179 additions & 320 deletions crates/wit-bindgen-go/src/interface.rs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion examples/go/hello-client/cmd/hello-client-nats/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import (
"log/slog"
"os"

"github.com/nats-io/nats.go"
"wrpc.io/examples/go/hello-client/bindings/wrpc_examples/hello/handler"
wrpcnats "wrpc.io/go/nats"
"github.com/nats-io/nats.go"
)

func run() (err error) {
Expand Down
2 changes: 1 addition & 1 deletion examples/go/hello-server/cmd/hello-server-nats/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import (
"os/signal"
"syscall"

"github.com/nats-io/nats.go"
server "wrpc.io/examples/go/hello-server/bindings"
wrpcnats "wrpc.io/go/nats"
"github.com/nats-io/nats.go"
)

type Handler struct{}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ import (
"sync"
"syscall"

"github.com/google/uuid"
"github.com/nats-io/nats.go"
server "wrpc.io/examples/go/resources-server/bindings"
"wrpc.io/examples/go/resources-server/bindings/exports/wrpc_examples/resources/resources"
wrpc "wrpc.io/go"
wrpcnats "wrpc.io/go/nats"
"github.com/google/uuid"
"github.com/nats-io/nats.go"
)

type Foo struct {
Expand Down
Loading

0 comments on commit 5ba49b1

Please sign in to comment.