Documentation
¶
Index ¶
Constants ¶
View Source
const ( SleepTime = time.Microsecond * 100 MaxBatchSize = 32 MaxLatency = 5000 )
Variables ¶
This section is empty.
Functions ¶
func GenerateUUID ¶ added in v0.5.0
func GenerateUUID() string
func GetNowTime ¶ added in v0.5.0
Types ¶
type BatchHandler ¶ added in v0.5.0
type BatchHandler struct {
MaxBatchSize int
MaxLatency int
// contains filtered or unexported fields
}
func New ¶ added in v0.5.0
func New(maxBatchSize int, maxLatency int, handler http.Handler, logger *zap.SugaredLogger) *BatchHandler
func (*BatchHandler) Consume ¶ added in v0.5.0
func (handler *BatchHandler) Consume()
func (*BatchHandler) ServeHTTP ¶ added in v0.5.0
func (handler *BatchHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type BatcherInfo ¶ added in v0.5.0
type BatcherInfo struct {
Path string
BatchID string
Request *http.Request
Instances []interface{}
PredictionResponse PredictionResponse
ContextMap map[*context.Context]InputInfo
Start time.Time
Now time.Time
CurrentInputLen int
}
func (*BatcherInfo) InitializeInfo ¶ added in v0.5.0
func (batcherInfo *BatcherInfo) InitializeInfo()
type PredictionResponse ¶ added in v0.5.0
type PredictionResponse struct {
Predictions []interface{} `json:"predictions"`
}
type ResponseError ¶ added in v0.5.0
type ResponseError struct {
Message string `json:"message"`
}
Click to show internal directories.
Click to hide internal directories.