Documentation ¶
Index ¶
- Constants
- Variables
- type Base
- type Config
- type Context
- func (slf *Context) Child(id string) *PID
- func (slf *Context) Children() []*PID
- func (slf *Context) Engine() *Engine
- func (slf *Context) Forward(pid *PID)
- func (slf *Context) GetPID(name string, tags ...string) *PID
- func (slf *Context) Message() any
- func (slf *Context) PID() *PID
- func (slf *Context) Parent() *PID
- func (slf *Context) Receiver() Receiver
- func (slf *Context) Request(pid *PID, msg any, timeout time.Duration) *Response
- func (slf *Context) Response(msg any)
- func (slf *Context) Send(pid *PID, msg any)
- func (slf *Context) SendRepeat(pid *PID, msg any, interval time.Duration) SendRepeater
- func (slf *Context) Sender() *PID
- func (slf *Context) SpawnChild(producer Producer, name string, opts ...Option) *PID
- func (slf *Context) SpawnChildFunc(fn func(ctx *Context), name string, opts ...Option) *PID
- type DeadLetter
- type Engine
- func (slf *Engine) Address() string
- func (slf *Engine) Poison(pid *PID, wg ...*sync.WaitGroup)
- func (slf *Engine) Request(pid *PID, message any, timeout time.Duration) *Response
- func (slf *Engine) Send(pid *PID, msg any)
- func (slf *Engine) SendLocal(target *PID, msg any, sender *PID)
- func (slf *Engine) SendRepeat(pid *PID, msg any, interval time.Duration) SendRepeater
- func (slf *Engine) SendWithSender(pid *PID, msg any, sender *PID)
- func (slf *Engine) Spawn(producer Producer, name string, opts ...Option) *PID
- func (slf *Engine) SpawnFunc(fn func(*Context), id string, opts ...Option) *PID
- func (slf *Engine) SpawnProc(proc Processor) *PID
- func (slf *Engine) WithRemoter(remoter Remoter)
- type Envelope
- type EventActivation
- type EventDeadLetter
- type EventFunc
- type EventStream
- type EventSub
- type EventTermination
- type Inbox
- type InternalError
- type MiddlewareFunc
- type Option
- type Options
- type PID
- func (slf *PID) Child(id string, tags ...string) *PID
- func (m *PID) CloneMessageVT() proto.Message
- func (m *PID) CloneVT() *PID
- func (*PID) Descriptor() ([]byte, []int)deprecated
- func (this *PID) EqualMessageVT(thatMsg proto.Message) bool
- func (this *PID) EqualVT(that *PID) bool
- func (slf *PID) Equals(other *PID) bool
- func (x *PID) GetAddress() string
- func (x *PID) GetID() string
- func (slf *PID) HasTag(tag string) bool
- func (slf *PID) LookupKey() uint64
- func (m *PID) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *PID) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error)
- func (m *PID) MarshalToVT(dAtA []byte) (int, error)
- func (m *PID) MarshalToVTStrict(dAtA []byte) (int, error)
- func (m *PID) MarshalVT() (dAtA []byte, err error)
- func (m *PID) MarshalVTStrict() (dAtA []byte, err error)
- func (*PID) ProtoMessage()
- func (x *PID) ProtoReflect() protoreflect.Message
- func (x *PID) Reset()
- func (m *PID) SizeVT() (n int)
- func (slf *PID) String() string
- func (m *PID) UnmarshalVT(dAtA []byte) error
- type Processor
- type Producer
- type ReceiveFunc
- type Receiver
- type Registry
- type Remoter
- type Response
- type Scheduler
- type SendRepeater
- type Started
- type Stopped
Constants ¶
View Source
const ( IDLE int32 = iota RUNNING )
View Source
const LocalLookupAddr = "local"
Variables ¶
View Source
var ( ErrInvalidLength = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflow = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroup = fmt.Errorf("proto: unexpected end of group") )
View Source
var File_actor_proto protoreflect.FileDescriptor
Functions ¶
This section is empty.
Types ¶
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
func (*Context) SendRepeat ¶
func (*Context) SpawnChild ¶
type DeadLetter ¶
type DeadLetter struct {
// contains filtered or unexported fields
}
func NewDeadLetter ¶
func NewDeadLetter(eventStream *EventStream) *DeadLetter
func (*DeadLetter) Invoke ¶
func (slf *DeadLetter) Invoke(envelopes []Envelope)
func (*DeadLetter) PID ¶
func (slf *DeadLetter) PID() *PID
func (*DeadLetter) Shutdown ¶
func (slf *DeadLetter) Shutdown(wg *sync.WaitGroup)
func (*DeadLetter) Start ¶
func (slf *DeadLetter) Start()
type Engine ¶
type Engine struct { EventStream *EventStream Registry *Registry // contains filtered or unexported fields }
func (*Engine) SendRepeat ¶
func (*Engine) WithRemoter ¶
type Envelope ¶
func (*Envelope) GetMessage ¶
type EventActivation ¶
type EventActivation struct{ PID *PID }
type EventDeadLetter ¶
type EventStream ¶
type EventStream struct {
// contains filtered or unexported fields
}
func NewEventStream ¶
func NewEventStream() *EventStream
func (*EventStream) Len ¶
func (slf *EventStream) Len() int
func (*EventStream) Publish ¶
func (slf *EventStream) Publish(msg any)
func (*EventStream) Subscribe ¶
func (slf *EventStream) Subscribe(fn EventFunc) *EventSub
func (*EventStream) Unsubscribe ¶
func (slf *EventStream) Unsubscribe(sub *EventSub)
type EventTermination ¶
type EventTermination struct{ PID *PID }
type Inbox ¶
type Inbox struct {
// contains filtered or unexported fields
}
func NewInbox ¶
func NewInbox[T constraints.Signed](size T) *Inbox
type InternalError ¶
type MiddlewareFunc ¶
type MiddlewareFunc = func(ReceiveFunc) ReceiveFunc
type Option ¶
type Option func(*Options)
func WithInboxSize ¶
func WithMaxRestarts ¶
func WithMiddleware ¶
func WithMiddleware(middleware ...MiddlewareFunc) Option
func WithRestartDelay ¶
type Options ¶
type Options struct { Producer Producer Name string Tags []string MaxRestarts int32 RestartDelay time.Duration InboxSize int Middleware []MiddlewareFunc }
func DefaultOpts ¶
type PID ¶
type PID struct { Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` ID string `protobuf:"bytes,2,opt,name=ID,proto3" json:"ID,omitempty"` // contains filtered or unexported fields }
func (*PID) CloneMessageVT ¶
func (*PID) Descriptor
deprecated
func (*PID) GetAddress ¶
func (*PID) MarshalToSizedBufferVTStrict ¶
func (*PID) MarshalVTStrict ¶
func (*PID) ProtoMessage ¶
func (*PID) ProtoMessage()
func (*PID) ProtoReflect ¶
func (x *PID) ProtoReflect() protoreflect.Message
func (*PID) UnmarshalVT ¶
type ReceiveFunc ¶
type ReceiveFunc = func(*Context)
type Scheduler ¶
type Scheduler interface { Schedule(fn func()) Throughput() int }
func NewScheduler ¶
type SendRepeater ¶
type SendRepeater struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.