Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrClosed = errors.New("lazy grpc conn closed")
Functions ¶
This section is empty.
Types ¶
type Conn ¶
type Conn interface { // GetConn will block until the grpc.ClientConn is ready to use. // If the context is done, return immediately with the context.Canceled or Context.DeadlineExceeded error. // Return ErrClosed if the lazy grpc conn is closed. GetConn(ctx context.Context) (*grpc.ClientConn, error) // Close closes the lazy grpc conn. // Close the underlying grpc conn if it is already created. Close() }
Conn is a lazy grpc conn implementation. grpc.Dial operation will block until new grpc conn is created at least once. Conn will dial the underlying grpc conn asynchronously to avoid dependency cycle of milvus component when create grpc client. TODO: Remove in future if we can refactor the dependency cycle.
type Service ¶
Service is a lazy grpc service.
func WithServiceCreator ¶
func WithServiceCreator[T any](conn Conn, serviceCreator func(grpc.ClientConnInterface) T) Service[T]
WithServiceCreator creates a lazy grpc service with a service creator.
Click to show internal directories.
Click to hide internal directories.