internal/jsonrpc2_v2: move the idle timeout handling out of the server
Change-Id: Ia7dedd84171f4fc4818fb00b154c21b04887391f Reviewed-on: https://go-review.googlesource.com/c/tools/+/305129 Trust: Ian Cottrell <iancottrell@google.com> Run-TryBot: Ian Cottrell <iancottrell@google.com> gopls-CI: kokoro <noreply+kokoro@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Robert Findley <rfindley@google.com>
This commit is contained in:
parent
cf8963447b
commit
76e263b8c9
1 changed files with 163 additions and 101 deletions
|
|
@ -68,6 +68,15 @@ func (a *async) done() {
|
|||
close(a.ready)
|
||||
}
|
||||
|
||||
func (a *async) isDone() bool {
|
||||
select {
|
||||
case <-a.ready:
|
||||
return true
|
||||
default:
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
func (a *async) wait() error {
|
||||
<-a.ready
|
||||
err := <-a.errBox
|
||||
|
|
|
|||
Loading…
Reference in a new issue