mirror of
https://github.com/golang/go
synced 2024-11-23 16:50:06 -07:00
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
|
||||
// discarded.
|
||||
type ClientCodec interface {
|
||||
// WriteRequest must be safe for concurrent use by multiple goroutines.
|
||||
WriteRequest(*Request, interface{}) error
|
||||
ReadResponseHeader(*Response) error
|
||||
ReadResponseBody(interface{}) error
|
||||
|
@ -616,6 +616,7 @@ func RegisterName(name string, rcvr interface{}) error {
|
||||
type ServerCodec interface {
|
||||
ReadRequestHeader(*Request) error
|
||||
ReadRequestBody(interface{}) error
|
||||
// WriteResponse must be safe for concurrent use by multiple goroutines.
|
||||
WriteResponse(*Response, interface{}) error
|
||||
|
||||
Close() error
|
||||
|
Loading…
Reference in New Issue
Block a user