Merge pull request #4895 from xiang90/client_doc

client: doc that client is thread-safe
release-3.0
Xiang Li 2016-03-29 09:36:01 -07:00
commit bb8619f4f7
2 changed files with 5 additions and 0 deletions

View File

@ -34,6 +34,8 @@ Create a Config and exchange it for a Client:
// handle error
}
Clients are safe for concurrent use by multiple goroutines.
Create a KeysAPI using the Client, then use it to interact with etcd:
kAPI := client.NewKeysAPI(c)

View File

@ -38,6 +38,9 @@
// }
// // use the response
//
// The Client has internal state (watchers and leases), so Clients should be reused instead of created as needed.
// Clients are safe for concurrent use by multiple goroutines.
//
// etcd client returns 2 types of errors:
//
// 1. context error: canceled or deadline exceeded.