mirror of https://github.com/golang/go.git
net/rpc: document thread safety requirements of codec types.
Fixes #6306. R=golang-dev, bradfitz, r CC=golang-dev https://golang.org/cl/13474043
This commit is contained in:
parent
1a819be590
commit
1e71e74262
|
|
@ -58,6 +58,7 @@ type Client struct {
|
||||||
// argument to force the body of the response to be read and then
|
// argument to force the body of the response to be read and then
|
||||||
// discarded.
|
// discarded.
|
||||||
type ClientCodec interface {
|
type ClientCodec interface {
|
||||||
|
// WriteRequest must be safe for concurrent use by multiple goroutines.
|
||||||
WriteRequest(*Request, interface{}) error
|
WriteRequest(*Request, interface{}) error
|
||||||
ReadResponseHeader(*Response) error
|
ReadResponseHeader(*Response) error
|
||||||
ReadResponseBody(interface{}) error
|
ReadResponseBody(interface{}) error
|
||||||
|
|
|
||||||
|
|
@ -616,6 +616,7 @@ func RegisterName(name string, rcvr interface{}) error {
|
||||||
type ServerCodec interface {
|
type ServerCodec interface {
|
||||||
ReadRequestHeader(*Request) error
|
ReadRequestHeader(*Request) error
|
||||||
ReadRequestBody(interface{}) error
|
ReadRequestBody(interface{}) error
|
||||||
|
// WriteResponse must be safe for concurrent use by multiple goroutines.
|
||||||
WriteResponse(*Response, interface{}) error
|
WriteResponse(*Response, interface{}) error
|
||||||
|
|
||||||
Close() error
|
Close() error
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue