router

package
v0.0.0-...-76c172a Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2024 License: Apache-2.0 Imports: 10 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_routercontracts_proto protoreflect.FileDescriptor

Functions

func NewBroadcastGroup

func NewBroadcastGroup(routees ...*actor.PID) *actor.Props

func NewBroadcastPool

func NewBroadcastPool(size int, opts ...actor.PropsOption) *actor.Props

func NewConsistentHashGroup

func NewConsistentHashGroup(routees ...*actor.PID) *actor.Props

func NewConsistentHashPool

func NewConsistentHashPool(size int, opts ...actor.PropsOption) *actor.Props

func NewRandomGroup

func NewRandomGroup(routees ...*actor.PID) *actor.Props

func NewRandomPool

func NewRandomPool(size int, opts ...actor.PropsOption) *actor.Props

func NewRoundRobinGroup

func NewRoundRobinGroup(routees ...*actor.PID) *actor.Props

func NewRoundRobinPool

func NewRoundRobinPool(size int, opts ...actor.PropsOption) *actor.Props

Types

type AddRoutee

type AddRoutee struct {
	PID *actor.PID `protobuf:"bytes,1,opt,name=PID,proto3" json:"PID,omitempty"`
	// contains filtered or unexported fields
}

func (*AddRoutee) Descriptor deprecated

func (*AddRoutee) Descriptor() ([]byte, []int)

Deprecated: Use AddRoutee.ProtoReflect.Descriptor instead.

func (*AddRoutee) GetPID

func (x *AddRoutee) GetPID() *actor.PID

func (*AddRoutee) ManagementMessage

func (*AddRoutee) ManagementMessage()

func (*AddRoutee) ProtoMessage

func (*AddRoutee) ProtoMessage()

func (*AddRoutee) ProtoReflect

func (x *AddRoutee) ProtoReflect() protoreflect.Message

func (*AddRoutee) Reset

func (x *AddRoutee) Reset()

func (*AddRoutee) String

func (x *AddRoutee) String() string

type AdjustPoolSize

type AdjustPoolSize struct {
	Change int32 `protobuf:"varint,1,opt,name=change,proto3" json:"change,omitempty"`
	// contains filtered or unexported fields
}

func (*AdjustPoolSize) Descriptor deprecated

func (*AdjustPoolSize) Descriptor() ([]byte, []int)

Deprecated: Use AdjustPoolSize.ProtoReflect.Descriptor instead.

func (*AdjustPoolSize) GetChange

func (x *AdjustPoolSize) GetChange() int32

func (*AdjustPoolSize) ManagementMessage

func (*AdjustPoolSize) ManagementMessage()

func (*AdjustPoolSize) ProtoMessage

func (*AdjustPoolSize) ProtoMessage()

func (*AdjustPoolSize) ProtoReflect

func (x *AdjustPoolSize) ProtoReflect() protoreflect.Message

func (*AdjustPoolSize) Reset

func (x *AdjustPoolSize) Reset()

func (*AdjustPoolSize) String

func (x *AdjustPoolSize) String() string

type BroadcastMessage

type BroadcastMessage struct {
	Message interface{}
}

func (*BroadcastMessage) ManagementMessage

func (*BroadcastMessage) ManagementMessage()

type GetRoutees

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

func (*GetRoutees) Descriptor deprecated

func (*GetRoutees) Descriptor() ([]byte, []int)

Deprecated: Use GetRoutees.ProtoReflect.Descriptor instead.

func (*GetRoutees) ManagementMessage

func (*GetRoutees) ManagementMessage()

func (*GetRoutees) ProtoMessage

func (*GetRoutees) ProtoMessage()

func (*GetRoutees) ProtoReflect

func (x *GetRoutees) ProtoReflect() protoreflect.Message

func (*GetRoutees) Reset

func (x *GetRoutees) Reset()

func (*GetRoutees) String

func (x *GetRoutees) String() string

type GroupRouter

type GroupRouter struct {
	Routees *actor.PIDSet
}

func (*GroupRouter) OnStarted

func (config *GroupRouter) OnStarted(context actor.Context, props *actor.Props, state State)

func (*GroupRouter) RouterType

func (config *GroupRouter) RouterType() RouterType

type Hasher

type Hasher interface {
	Hash() string
}

type ManagementMessage

type ManagementMessage interface {
	ManagementMessage()
}

type PoolRouter

type PoolRouter struct {
	PoolSize int
}

func (*PoolRouter) OnStarted

func (config *PoolRouter) OnStarted(context actor.Context, props *actor.Props, state State)

func (*PoolRouter) RouterType

func (config *PoolRouter) RouterType() RouterType

type RemoveRoutee

type RemoveRoutee struct {
	PID *actor.PID `protobuf:"bytes,1,opt,name=PID,proto3" json:"PID,omitempty"`
	// contains filtered or unexported fields
}

func (*RemoveRoutee) Descriptor deprecated

func (*RemoveRoutee) Descriptor() ([]byte, []int)

Deprecated: Use RemoveRoutee.ProtoReflect.Descriptor instead.

func (*RemoveRoutee) GetPID

func (x *RemoveRoutee) GetPID() *actor.PID

func (*RemoveRoutee) ManagementMessage

func (*RemoveRoutee) ManagementMessage()

func (*RemoveRoutee) ProtoMessage

func (*RemoveRoutee) ProtoMessage()

func (*RemoveRoutee) ProtoReflect

func (x *RemoveRoutee) ProtoReflect() protoreflect.Message

func (*RemoveRoutee) Reset

func (x *RemoveRoutee) Reset()

func (*RemoveRoutee) String

func (x *RemoveRoutee) String() string

type Routees

type Routees struct {
	PIDs []*actor.PID `protobuf:"bytes,1,rep,name=PIDs,proto3" json:"PIDs,omitempty"`
	// contains filtered or unexported fields
}

func (*Routees) Descriptor deprecated

func (*Routees) Descriptor() ([]byte, []int)

Deprecated: Use Routees.ProtoReflect.Descriptor instead.

func (*Routees) GetPIDs

func (x *Routees) GetPIDs() []*actor.PID

func (*Routees) ProtoMessage

func (*Routees) ProtoMessage()

func (*Routees) ProtoReflect

func (x *Routees) ProtoReflect() protoreflect.Message

func (*Routees) Reset

func (x *Routees) Reset()

func (*Routees) String

func (x *Routees) String() string

type RouterConfig

type RouterConfig interface {
	RouterType() RouterType
	OnStarted(context actor.Context, props *actor.Props, state State)
	CreateRouterState() State
}

type RouterType

type RouterType int
const (
	GroupRouterType RouterType = iota
	PoolRouterType
)

type State

type State interface {
	RouteMessage(message interface{})
	SetRoutees(routees *actor.PIDSet)
	GetRoutees() *actor.PIDSet
	SetSender(sender actor.SenderContext)
}

A type that satisfies router.Interface can be used as a router

Jump to

Keyboard shortcuts

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