Skip to content

Commit

Permalink
Conn.sender: mpsc -> spsc
Browse files Browse the repository at this point in the history
We don't actually need multiple-producers here, since we're always
holding Conn.mu when we send.
  • Loading branch information
zenhack committed Dec 1, 2022
1 parent c8fd46a commit 3e66d0e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions rpc/rpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (

"capnproto.org/go/capnp/v3"
"capnproto.org/go/capnp/v3/exc"
"capnproto.org/go/capnp/v3/exp/mpsc"
"capnproto.org/go/capnp/v3/exp/spsc"
"capnproto.org/go/capnp/v3/internal/syncutil"
"capnproto.org/go/capnp/v3/rpc/transport"
rpccp "capnproto.org/go/capnp/v3/std/capnp/rpc"
Expand Down Expand Up @@ -87,7 +87,7 @@ type Conn struct {
closing bool // used to make shutdown() idempotent
closed chan struct{} // closed when shutdown() returns

sender *mpsc.Queue[asyncSend]
sender spsc.Queue[asyncSend]

// Tables
questions []*question
Expand Down Expand Up @@ -144,7 +144,7 @@ func NewConn(t Transport, opts *Options) *Conn {
bgcancel: cancel,
answers: make(map[answerID]*answer),
imports: make(map[importID]*impent),
sender: mpsc.New[asyncSend](),
sender: spsc.New[asyncSend](),
}
if opts != nil {
c.bootstrap = opts.BootstrapClient
Expand Down

0 comments on commit 3e66d0e

Please sign in to comment.