mirror of
https://gitee.com/milvus-io/milvus.git
synced 2025-12-06 17:18:35 +08:00
issue: #38399 pr: #39522 - broadcast message can carry multi resource key now. - implement event-based notification for broadcast messages - broadcast message use broadcast id as a unique identifier in message - broadcasted message on vchannels keep the broadcasted vchannel now. - broadcasted message and broadcast message have a common broadcast header now. --------- Signed-off-by: chyezh <chyezh@outlook.com>
38 lines
1.1 KiB
Go
38 lines
1.1 KiB
Go
package broadcaster
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/milvus-io/milvus/internal/streamingcoord/server/broadcaster/registry"
|
|
"github.com/milvus-io/milvus/pkg/streaming/util/message"
|
|
"github.com/milvus-io/milvus/pkg/streaming/util/types"
|
|
)
|
|
|
|
type Broadcaster interface {
|
|
// Broadcast broadcasts the message to all channels.
|
|
Broadcast(ctx context.Context, msg message.BroadcastMutableMessage) (*types.BroadcastAppendResult, error)
|
|
|
|
// Ack acknowledges the message at the specified vchannel.
|
|
Ack(ctx context.Context, req types.BroadcastAckRequest) error
|
|
|
|
// Watch watches the broadcast event.
|
|
NewWatcher() (Watcher, error)
|
|
|
|
// Close closes the broadcaster.
|
|
Close()
|
|
}
|
|
|
|
// Watcher is the interface for watching the broadcast event.
|
|
type Watcher interface {
|
|
// ObserveResourceKeyEvent observes the resource key event.
|
|
ObserveResourceKeyEvent(ctx context.Context, ev *message.BroadcastEvent) error
|
|
|
|
// EventChan returns the event channel.
|
|
EventChan() <-chan *message.BroadcastEvent
|
|
|
|
// Close closes the watcher.
|
|
Close()
|
|
}
|
|
|
|
type AppendOperator = registry.AppendOperator
|