cluster

package
v3.0.16 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Broadcast

func Broadcast(ctx context.Context, name string, args []interface{}, next core.NextInvokeHandler) (result []interface{}, err error)

Broadcast on Cluster.

func Forking

func Forking(ctx context.Context, request []byte, next core.NextIOHandler) (response []byte, err error)

Forking on Cluster.

Types

type Cluster

type Cluster struct {
	Config
}

Cluster plugin for hprose.

func New

func New(config ...Config) (cluster *Cluster)

New returns a Cluster instance.

func (*Cluster) Handler

func (c *Cluster) Handler(ctx context.Context, request []byte, next core.NextIOHandler) (response []byte, err error)

Handler for Cluster.

type Config

type Config struct {
	Retry      int
	Idempotent bool
	OnSuccess  func(context.Context)
	OnFailure  func(context.Context)
	OnRetry    func(context.Context) time.Duration
	// contains filtered or unexported fields
}

Config for cluster.

func FailfastConfig

func FailfastConfig(onFailure func(context.Context)) (config Config)

FailfastConfig for cluster.

func FailoverConfig

func FailoverConfig(options ...Option) (config Config)

FailoverConfig for cluster.

func FailtryConfig

func FailtryConfig(options ...Option) (config Config)

FailtryConfig for cluster.

type Option

type Option func(*Config)

Option for cluster config.

func WithIdempotent

func WithIdempotent(idempotent bool) Option

WithIdempotent returns an idempotent Option for cluster config.

func WithMaxInterval

func WithMaxInterval(maxInterval time.Duration) Option

WithMaxInterval returns a retry maxInterval Option for cluster config.

func WithMinInterval

func WithMinInterval(minInterval time.Duration) Option

WithMinInterval returns a retry minInterval Option for cluster config.

func WithRetry

func WithRetry(retry int) Option

WithRetry returns a retry Option for cluster config.

Jump to

Keyboard shortcuts

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