client

package
v1.4.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 22, 2023 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Created int32 = iota
	Starting
	Ready
	Stopping
	Stopped
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CRDTOperationTargetFn added in v1.4.0

type CRDTOperationTargetFn func(excluded map[types.UUID]struct{}) (*pubcluster.MemberInfo, []proto.Pair)

type Client

type Client struct {
	InvocationHandler    invocation.Handler
	Logger               ilogger.LogAdaptor
	ConnectionManager    *icluster.ConnectionManager
	ViewListenerService  *icluster.ViewListenerService
	InvocationService    *invocation.Service
	InvocationFactory    *icluster.ConnectionInvocationFactory
	SerializationService *serialization.Service
	EventDispatcher      *event.DispatchService
	StatsService         *stats.Service

	PartitionService *icluster.PartitionService
	ClusterService   *icluster.Service
	Invoker          *Invoker
	// contains filtered or unexported fields
}

func New

func New(config *Config, schemaCh chan serialization.SchemaMsg) (*Client, error)

func (*Client) AddAfterShutdownHandler added in v1.3.1

func (c *Client) AddAfterShutdownHandler(handler func(ctx context.Context))

func (*Client) AddBeforeShutdownHandler added in v1.3.1

func (c *Client) AddBeforeShutdownHandler(handler func(ctx context.Context))

func (*Client) Name

func (c *Client) Name() string

Name returns client's name. Use config.Name to set the client name. If not set manually, an automatically generated name is used.

func (*Client) Shutdown

func (c *Client) Shutdown(ctx context.Context) error

Shutdown disconnects the client from the cluster and frees resources allocated by the client.

func (*Client) Start

func (c *Client) Start(ctx context.Context) error

func (*Client) State

func (c *Client) State() int32

type Config

type Config struct {
	Name          string
	Cluster       *cluster.Config
	Failover      *cluster.FailoverConfig
	Serialization *pubserialization.Config
	Logger        *logger.Config
	Labels        []string
	StatsEnabled  bool
	StatsPeriod   time.Duration
}

func NewConfig

func NewConfig() *Config

func (*Config) Validate

func (c *Config) Validate() error

type Invoker added in v1.4.0

type Invoker struct {
	// contains filtered or unexported fields
}

func NewInvoker added in v1.4.0

func (*Invoker) CB added in v1.4.0

func (iv *Invoker) CB() *cb.CircuitBreaker

func (*Invoker) Factory added in v1.4.0

func (*Invoker) InvokeOnConnection added in v1.4.0

func (iv *Invoker) InvokeOnConnection(ctx context.Context, req *proto.ClientMessage, conn *cluster.Connection) (*proto.ClientMessage, error)

func (*Invoker) InvokeOnConnectionWithHandler added in v1.4.0

func (iv *Invoker) InvokeOnConnectionWithHandler(ctx context.Context, req *proto.ClientMessage, conn *cluster.Connection, handler proto.ClientMessageHandler) (*proto.ClientMessage, error)

func (*Invoker) InvokeOnMemberCRDT added in v1.4.0

func (iv *Invoker) InvokeOnMemberCRDT(ctx context.Context, makeReq func(target types.UUID, clocks []proto.Pair) *proto.ClientMessage, crdtFn CRDTOperationTargetFn) (*proto.ClientMessage, error)

func (*Invoker) InvokeOnPartition added in v1.4.0

func (iv *Invoker) InvokeOnPartition(ctx context.Context, request *proto.ClientMessage, partitionID int32) (*proto.ClientMessage, error)

func (*Invoker) InvokeOnPartitionAsync added in v1.4.0

func (iv *Invoker) InvokeOnPartitionAsync(ctx context.Context, request *proto.ClientMessage, partitionID int32, now time.Time) (invocation.Invocation, error)

func (*Invoker) InvokeOnRandomTarget added in v1.4.0

func (iv *Invoker) InvokeOnRandomTarget(ctx context.Context, request *proto.ClientMessage, handler proto.ClientMessageHandler) (*proto.ClientMessage, error)

func (*Invoker) InvokeUrgentOnRandomTarget added in v1.4.0

func (iv *Invoker) InvokeUrgentOnRandomTarget(ctx context.Context, request *proto.ClientMessage, handler proto.ClientMessageHandler) (*proto.ClientMessage, error)

func (*Invoker) SendInvocation added in v1.4.0

func (iv *Invoker) SendInvocation(ctx context.Context, inv invocation.Invocation) error

func (*Invoker) TryInvoke added in v1.4.0

func (iv *Invoker) TryInvoke(ctx context.Context, f cb.TryHandler) (*proto.ClientMessage, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL