router

package
v0.0.0-...-be88ffe Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthProtos = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowProtos   = fmt.Errorf("proto: integer overflow")
)

Functions

func NewBroadcastGroup

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

func NewBroadcastPool

func NewBroadcastPool(size int) *actor.Props

func NewConsistentHashGroup

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

func NewConsistentHashPool

func NewConsistentHashPool(size int) *actor.Props

func NewRandomGroup

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

func NewRandomPool

func NewRandomPool(size int) *actor.Props

func NewRoundRobinGroup

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

func NewRoundRobinPool

func NewRoundRobinPool(size int) *actor.Props

Types

type AddRoutee

type AddRoutee struct {
	PID *actor.PID `protobuf:"bytes,1,opt,name=PID,proto3" json:"PID,omitempty"`
}

func (*AddRoutee) Descriptor

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

func (*AddRoutee) Equal

func (this *AddRoutee) Equal(that interface{}) bool

func (*AddRoutee) GetPID

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

func (*AddRoutee) GoString

func (this *AddRoutee) GoString() string

func (*AddRoutee) ManagementMessage

func (*AddRoutee) ManagementMessage()

func (*AddRoutee) Marshal

func (m *AddRoutee) Marshal() (dAtA []byte, err error)

func (*AddRoutee) MarshalTo

func (m *AddRoutee) MarshalTo(dAtA []byte) (int, error)

func (*AddRoutee) ProtoMessage

func (*AddRoutee) ProtoMessage()

func (*AddRoutee) Reset

func (m *AddRoutee) Reset()

func (*AddRoutee) Size

func (m *AddRoutee) Size() (n int)

func (*AddRoutee) String

func (this *AddRoutee) String() string

func (*AddRoutee) Unmarshal

func (m *AddRoutee) Unmarshal(dAtA []byte) error

func (*AddRoutee) XXX_DiscardUnknown

func (m *AddRoutee) XXX_DiscardUnknown()

func (*AddRoutee) XXX_Marshal

func (m *AddRoutee) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*AddRoutee) XXX_Merge

func (m *AddRoutee) XXX_Merge(src proto.Message)

func (*AddRoutee) XXX_Size

func (m *AddRoutee) XXX_Size() int

func (*AddRoutee) XXX_Unmarshal

func (m *AddRoutee) XXX_Unmarshal(b []byte) error

type AdjustPoolSize

type AdjustPoolSize struct {
	Change int32 `protobuf:"varint,1,opt,name=change,proto3" json:"change,omitempty"`
}

func (*AdjustPoolSize) Descriptor

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

func (*AdjustPoolSize) Equal

func (this *AdjustPoolSize) Equal(that interface{}) bool

func (*AdjustPoolSize) GetChange

func (m *AdjustPoolSize) GetChange() int32

func (*AdjustPoolSize) GoString

func (this *AdjustPoolSize) GoString() string

func (*AdjustPoolSize) ManagementMessage

func (*AdjustPoolSize) ManagementMessage()

func (*AdjustPoolSize) Marshal

func (m *AdjustPoolSize) Marshal() (dAtA []byte, err error)

func (*AdjustPoolSize) MarshalTo

func (m *AdjustPoolSize) MarshalTo(dAtA []byte) (int, error)

func (*AdjustPoolSize) ProtoMessage

func (*AdjustPoolSize) ProtoMessage()

func (*AdjustPoolSize) Reset

func (m *AdjustPoolSize) Reset()

func (*AdjustPoolSize) Size

func (m *AdjustPoolSize) Size() (n int)

func (*AdjustPoolSize) String

func (this *AdjustPoolSize) String() string

func (*AdjustPoolSize) Unmarshal

func (m *AdjustPoolSize) Unmarshal(dAtA []byte) error

func (*AdjustPoolSize) XXX_DiscardUnknown

func (m *AdjustPoolSize) XXX_DiscardUnknown()

func (*AdjustPoolSize) XXX_Marshal

func (m *AdjustPoolSize) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*AdjustPoolSize) XXX_Merge

func (m *AdjustPoolSize) XXX_Merge(src proto.Message)

func (*AdjustPoolSize) XXX_Size

func (m *AdjustPoolSize) XXX_Size() int

func (*AdjustPoolSize) XXX_Unmarshal

func (m *AdjustPoolSize) XXX_Unmarshal(b []byte) error

type BroadcastMessage

type BroadcastMessage struct {
	Message interface{}
}

func (*BroadcastMessage) ManagementMessage

func (*BroadcastMessage) ManagementMessage()

type GetRoutees

type GetRoutees struct {
}

func (*GetRoutees) Descriptor

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

func (*GetRoutees) Equal

func (this *GetRoutees) Equal(that interface{}) bool

func (*GetRoutees) GoString

func (this *GetRoutees) GoString() string

func (*GetRoutees) ManagementMessage

func (*GetRoutees) ManagementMessage()

func (*GetRoutees) Marshal

func (m *GetRoutees) Marshal() (dAtA []byte, err error)

func (*GetRoutees) MarshalTo

func (m *GetRoutees) MarshalTo(dAtA []byte) (int, error)

func (*GetRoutees) ProtoMessage

func (*GetRoutees) ProtoMessage()

func (*GetRoutees) Reset

func (m *GetRoutees) Reset()

func (*GetRoutees) Size

func (m *GetRoutees) Size() (n int)

func (*GetRoutees) String

func (this *GetRoutees) String() string

func (*GetRoutees) Unmarshal

func (m *GetRoutees) Unmarshal(dAtA []byte) error

func (*GetRoutees) XXX_DiscardUnknown

func (m *GetRoutees) XXX_DiscardUnknown()

func (*GetRoutees) XXX_Marshal

func (m *GetRoutees) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*GetRoutees) XXX_Merge

func (m *GetRoutees) XXX_Merge(src proto.Message)

func (*GetRoutees) XXX_Size

func (m *GetRoutees) XXX_Size() int

func (*GetRoutees) XXX_Unmarshal

func (m *GetRoutees) XXX_Unmarshal(b []byte) error

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"`
}

func (*RemoveRoutee) Descriptor

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

func (*RemoveRoutee) Equal

func (this *RemoveRoutee) Equal(that interface{}) bool

func (*RemoveRoutee) GetPID

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

func (*RemoveRoutee) GoString

func (this *RemoveRoutee) GoString() string

func (*RemoveRoutee) ManagementMessage

func (*RemoveRoutee) ManagementMessage()

func (*RemoveRoutee) Marshal

func (m *RemoveRoutee) Marshal() (dAtA []byte, err error)

func (*RemoveRoutee) MarshalTo

func (m *RemoveRoutee) MarshalTo(dAtA []byte) (int, error)

func (*RemoveRoutee) ProtoMessage

func (*RemoveRoutee) ProtoMessage()

func (*RemoveRoutee) Reset

func (m *RemoveRoutee) Reset()

func (*RemoveRoutee) Size

func (m *RemoveRoutee) Size() (n int)

func (*RemoveRoutee) String

func (this *RemoveRoutee) String() string

func (*RemoveRoutee) Unmarshal

func (m *RemoveRoutee) Unmarshal(dAtA []byte) error

func (*RemoveRoutee) XXX_DiscardUnknown

func (m *RemoveRoutee) XXX_DiscardUnknown()

func (*RemoveRoutee) XXX_Marshal

func (m *RemoveRoutee) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*RemoveRoutee) XXX_Merge

func (m *RemoveRoutee) XXX_Merge(src proto.Message)

func (*RemoveRoutee) XXX_Size

func (m *RemoveRoutee) XXX_Size() int

func (*RemoveRoutee) XXX_Unmarshal

func (m *RemoveRoutee) XXX_Unmarshal(b []byte) error

type Routees

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

func (*Routees) Descriptor

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

func (*Routees) Equal

func (this *Routees) Equal(that interface{}) bool

func (*Routees) GetPIDs

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

func (*Routees) GoString

func (this *Routees) GoString() string

func (*Routees) Marshal

func (m *Routees) Marshal() (dAtA []byte, err error)

func (*Routees) MarshalTo

func (m *Routees) MarshalTo(dAtA []byte) (int, error)

func (*Routees) ProtoMessage

func (*Routees) ProtoMessage()

func (*Routees) Reset

func (m *Routees) Reset()

func (*Routees) Size

func (m *Routees) Size() (n int)

func (*Routees) String

func (this *Routees) String() string

func (*Routees) Unmarshal

func (m *Routees) Unmarshal(dAtA []byte) error

func (*Routees) XXX_DiscardUnknown

func (m *Routees) XXX_DiscardUnknown()

func (*Routees) XXX_Marshal

func (m *Routees) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Routees) XXX_Merge

func (m *Routees) XXX_Merge(src proto.Message)

func (*Routees) XXX_Size

func (m *Routees) XXX_Size() int

func (*Routees) XXX_Unmarshal

func (m *Routees) XXX_Unmarshal(b []byte) error

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