func (s *etcdStore) Put(ctx context.Context, req *etcdserverpb.PutRequest) (*etcdserverpb.PutResponse, error) {
	ireq := etcdserverpb.InternalRaftRequest{ID: <-s.idgen, Put: req}
	msgc, errc, err := s.proposeInternalRaftRequest(ireq)
	if err != nil {
		return nil, err
	}
	select {
	case <-ctx.Done():
		s.cancelInternalRaftRequest(ireq)
		return nil, ctx.Err()
	case msg := <-msgc:
		return msg.(*etcdserverpb.PutResponse), nil
	case err := <-errc:
		return nil, err
	case <-s.quitc:
		return nil, errStopped
	}
}
func (s *etcdStore) Put(ctx context.Context, req *etcdserverpb.PutRequest) (*etcdserverpb.PutResponse, error) {
	ireq := etcdserverpb.InternalRaftRequest{ID: <-s.idgen, Put: req}
	msgc, errc, err := s.proposeInternalRaftRequest(ireq)
	if err != nil {
		return nil, err
	}
	select {
	case <-ctx.Done():
		s.cancelInternalRaftRequest(ireq)
		return nil, ctx.Err()
	case msg := <-msgc:
		return msg.(*etcdserverpb.PutResponse), nil
	case err := <-errc:
		return nil, err
	case <-s.quitc:
		return nil, errStopped
	}
}
func ( s * etcdStore ) Put ( ctx context . Context , req * etcdserverpb . PutRequest ) ( * etcdserverpb . PutResponse , error ) { ireq := etcdserverpb . InternalRaftRequest { ID : <- s . idgen , Put : req } msgc , errc , err := s . proposeInternalRaftRequest ( ireq ) if err != nil { return nil , err } select { case <- ctx . Done ( ) : s . cancelInternalRaftRequest ( ireq ) return nil , ctx . Err ( ) case msg := <- msgc : return msg . ( * etcdserverpb . PutResponse ) , nil case err := <- errc : return nil , err case <- s . quitc : return nil , errStopped } }
// Put implements gRPC KVServer.
// Put puts the given key into the store.
// A put request increases the revision of the store,
// and generates one event in the event history.
Put implements gRPC KVServer . Put puts the given key into the store . A put request increases the revision of the store and generates one event in the event history .