// OptServerMaxWritesPerRequest is a functional option on Server
// used to set the maximum number of writes allowed per request.
779841
func OptServerMaxWritesPerRequest(n int) ServerOption {
	return func(s *Server) error {
		s.maxWritesPerRequest = n
		return nil
	}
}
930553
func (c *client) SetMaxRate(ctx context.Context, rate int64) ([]string, error) {
	request := &throttlerdatapb.SetMaxRateRequest{
		Rate: rate,
	}

	response, err := c.gRPCClient.SetMaxRate(ctx, request)
	if err != nil {
		return nil, vterrors.FromGRPC(err)
	}
	return response.Names, nil
}
1326731
func (s *Server) MaxRates(_ context.Context, request *throttlerdatapb.MaxRatesRequest) (_ *throttlerdatapb.MaxRatesResponse, err error) {
	defer servenv.HandlePanic("throttler", &err)

	rates := s.manager.MaxRates()
	return &throttlerdatapb.MaxRatesResponse{
		Rates: rates,
	}, nil
}
407656
func (s *ListOfferingsInput) SetMaximumBitrate(v string) *ListOfferingsInput {
	s.MaximumBitrate = &v
	return s
}
1158683
func OptServerAttrStoreFunc(af func(string) AttrStore) ServerOption {
	return func(s *Server) error {
		s.holder.NewAttrStore = af
		return nil
	}
}
759748
func (f WriteHandlerFunc) ServeWrite(r Request, data []byte) byte {
	return f(r, data)
}
511170
func (nc *Conn) MaxPayload() int64 {
	nc.mu.RLock()
	defer nc.mu.RUnlock()
	return nc.info.MaxPayload
}
1149459
func (ep *endpoint) saveRcvBufSizeMax() int {
	max := ep.rcvBufSizeMax
	// Make sure no new packets will be handled regardless of the lock.
	ep.rcvBufSizeMax = 0
	// Release the lock acquired in beforeSave() so regular endpoint closing
	// logic can proceed after save.
	ep.rcvMu.Unlock()
	return max
}
1133633
func OptUseServer(s *fasthttp.Server) func(*App) {
	return func(app *App) {
		assertAppNotNill(app)
		if s == nil {
			panic(errors.New("cannot set nil as app server instance"))
		}
		app.serverBase = s
		app.serverBase.Handler = app.handler()
	}
}
261223
func MaxRecvMsgSize(m int) ServerOption {
	return newFuncServerOption(func(o *serverOptions) {
		o.maxReceiveMessageSize = m
	})
}
697790
func writeFetchRequestV1(w *bufio.Writer, correlationID int32, clientID string, topic string, partition int32, offset int64, minBytes int, maxBytes int, maxWait time.Duration) error {
	h := requestHeader{
		ApiKey:        int16(fetchRequest),
		ApiVersion:    int16(v1),
		CorrelationID: correlationID,
		ClientID:      clientID,
	}
	h.Size = (h.size() - 4) +
		4 + // replica ID
		4 + // max wait time
		4 + // min bytes
		4 + // topic array length
		sizeofString(topic) +
		4 + // partition array length
		4 + // partition
		8 + // offset
		4 // max bytes

	h.writeTo(w)
	writeInt32(w, -1) // replica ID
	writeInt32(w, milliseconds(maxWait))
	writeInt32(w, int32(minBytes))

	// topic array
	writeArrayLen(w, 1)
	writeString(w, topic)

	// partition array
	writeArrayLen(w, 1)
	writeInt32(w, partition)
	writeInt64(w, offset)
	writeInt32(w, int32(maxBytes))

	return w.Flush()
}
889613
func (s *FleetUtilization) SetMaximumPlayerSessionCount(v int64) *FleetUtilization {
	s.MaximumPlayerSessionCount = &v
	return s
}
816048
func GetMaximumDHCPMessageSize(o dhcp4.Options) (uint16, error) {
	v := o.Get(dhcp4.OptionMaximumDHCPMessageSize)
	if v == nil {
		return 0, dhcp4.ErrOptionNotPresent
	}
	var u Uint16
	return uint16(u), (&u).UnmarshalBinary(v)
}
1352957
func (m *ObserverMultiplexer) ServerRequest(hdr *Header, body interface{}) {
	mapConcurrent(func(n Observer) { n.ServerRequest(hdr, body) }, m.rpcObservers)
}
149155
func (f WriteHandlerFunc) ServeWrite(req Request, rsp ResponseWriter) {
	f(req, rsp)
}
1019345
func (s *UpdateProfileInput) SetMaxVolumeLimit(v int64) *UpdateProfileInput {
	s.MaxVolumeLimit = &v
	return s
}
96355
func (r *request) setWriteOptions(q *WriteOptions) {
	if q == nil {
		return
	}
	if q.Datacenter != "" {
		r.params.Set("dc", q.Datacenter)
	}
	if q.Token != "" {
		r.params.Set("token", q.Token)
	}
}