mirror of
https://github.com/pgsty/minio.git
synced 2026-07-28 08:26:17 +03:00
Improve tracing & notification scalability (#18903)
* Perform JSON encoding on remote machines and only forward byte slices. * Migrate tracing & notification to WebSockets.
This commit is contained in:
@@ -59,8 +59,10 @@ const (
|
||||
HandlerRenameData
|
||||
HandlerRenameFile
|
||||
HandlerReadAll
|
||||
|
||||
HandlerServerVerify
|
||||
HandlerTrace
|
||||
HandlerListen
|
||||
|
||||
// Add more above here ^^^
|
||||
// If all handlers are used, the type of Handler can be changed.
|
||||
// Handlers have no versioning, so non-compatible handler changes must result in new IDs.
|
||||
@@ -542,6 +544,20 @@ func (h *StreamTypeHandler[Payload, Req, Resp]) Register(m *Manager, handle func
|
||||
return h.register(m, handle, subroute...)
|
||||
}
|
||||
|
||||
// WithOutCapacity adjusts the output capacity from the handler perspective.
|
||||
// This must be done prior to registering the handler.
|
||||
func (h *StreamTypeHandler[Payload, Req, Resp]) WithOutCapacity(out int) *StreamTypeHandler[Payload, Req, Resp] {
|
||||
h.OutCapacity = out
|
||||
return h
|
||||
}
|
||||
|
||||
// WithInCapacity adjusts the input capacity from the handler perspective.
|
||||
// This must be done prior to registering the handler.
|
||||
func (h *StreamTypeHandler[Payload, Req, Resp]) WithInCapacity(in int) *StreamTypeHandler[Payload, Req, Resp] {
|
||||
h.InCapacity = in
|
||||
return h
|
||||
}
|
||||
|
||||
// RegisterNoInput a handler for one-way streaming with payload and output stream.
|
||||
// An optional subroute can be given. Multiple entries are joined with '/'.
|
||||
func (h *StreamTypeHandler[Payload, Req, Resp]) RegisterNoInput(m *Manager, handle func(ctx context.Context, p Payload, out chan<- Resp) *RemoteErr, subroute ...string) error {
|
||||
|
||||
Reference in New Issue
Block a user