Skip to content

Commit

Permalink
Construct the internal queue by value.
Browse files Browse the repository at this point in the history
  • Loading branch information
creachadair committed Mar 19, 2023
1 parent cf1bb22 commit 2670c9f
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions server.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ type Server struct {

mu *sync.Mutex // protects the fields below

nbar sync.WaitGroup // notification barrier (see the dispatch method)
err error // error from a previous operation
work chan struct{} // for signaling message availability
inq *mlink.Queue[jmessages] // inbound requests awaiting processing
ch channel.Channel // the channel to the client
nbar sync.WaitGroup // notification barrier (see the dispatch method)
err error // error from a previous operation
work chan struct{} // for signaling message availability
inq mlink.Queue[jmessages] // inbound requests awaiting processing
ch channel.Channel // the channel to the client

// For each request ID currently in-flight, this map carries a cancel
// function attached to the context that was sent to the handler.
Expand Down Expand Up @@ -109,7 +109,6 @@ func NewServer(mux Assigner, opts *ServerOptions) *Server {
mu: new(sync.Mutex),
start: opts.startTime(),
builtin: opts.allowBuiltin(),
inq: mlink.NewQueue[jmessages](),
used: make(map[string]context.CancelFunc),
call: make(map[string]*Response),
callID: 1,
Expand Down

0 comments on commit 2670c9f

Please sign in to comment.