mirror of
https://gitee.com/milvus-io/milvus.git
synced 2026-01-06 19:02:18 +08:00
Related to #39095 https://go.dev/doc/modules/version-numbers Update pkg version according to golang dep version convention --------- Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
29 lines
828 B
Go
29 lines
828 B
Go
package producer
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/milvus-io/milvus/pkg/v2/streaming/util/message"
|
|
"github.com/milvus-io/milvus/pkg/v2/streaming/util/types"
|
|
)
|
|
|
|
var _ Producer = (*producerImpl)(nil)
|
|
|
|
// Producer is the interface that wraps the basic produce method on grpc stream.
|
|
// Producer is work on a single stream on grpc,
|
|
// so Producer cannot recover from failure because of the stream is broken.
|
|
type Producer interface {
|
|
// Append sends the produce message to server.
|
|
// TODO: Support Batch produce here.
|
|
Append(ctx context.Context, msg message.MutableMessage) (*types.AppendResult, error)
|
|
|
|
// Check if a producer is available.
|
|
IsAvailable() bool
|
|
|
|
// Available returns a channel that will be closed when the producer is unavailable.
|
|
Available() <-chan struct{}
|
|
|
|
// Close close the producer client.
|
|
Close()
|
|
}
|