Documentation ¶
Index ¶
Constants ¶
View Source
const ( // IntByteLength defines the byte length of `length` for data IntByteLength = 4 // UUIDLength defines the string bits length UUIDLength = 36 // ErrorIDsKey defines the key for error IDs ErrorIDsKey = "error_ids" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Batching ¶
type Batching struct { Address string // socket file or "{host}:{port}" // contains filtered or unexported fields }
Batching provides HTTP handler and socket communication. It generate batch jobs when workers request and send the inference results (or error) to the right client.
func NewBatching ¶
func NewBatching(address, protocol string, batchSize, capacity int, maxLatency, timeout time.Duration) *Batching
NewBatching creates a Batching instance
func (*Batching) HandleHTTP ¶
func (b *Batching) HandleHTTP(ctx *fasthttp.RequestCtx)
HandleHTTP is the handler for fasthttp
type Job ¶
type Job struct {
// contains filtered or unexported fields
}
Job wrap the new request as a job waiting to be done by workers
type String2Bytes ¶
String2Bytes structure used in socket communication protocol
Click to show internal directories.
Click to hide internal directories.