Versions in this module Expand all Collapse all v1 v1.0.4 Jul 22, 2024 v1.0.3 Jul 22, 2024 v1.0.2 Jul 22, 2024 v1.0.1 Jul 18, 2024 Changes in this version + const DefaultPriority + var EmptyMessageHeader = make(messageHeader) + var ErrDeadLetter = errors.New("future: dead letter") + var ErrNameExists = errors.New("spawn: name exists") + var ErrTimeout = errors.New("future: timeout") + var File_actor_proto protoreflect.FileDescriptor + var TerminatedReason_name = map[int32]string + var TerminatedReason_value = map[string]int32 + func NewDeadLetter(actorSystem *ActorSystem) *deadLetterProcess + func NewGuardians(actorSystem *ActorSystem) *guardiansValue + func NewPriorityGoringQueue() *priorityQueue + func NewPriorityMpscQueue() *priorityQueue + func NewPriorityQueue(queueProducer func() queue) *priorityQueue + func SubscribeSupervision(actorSystem *ActorSystem) + func UnwrapEnvelope(message interface{}) (ReadonlyMessageHeader, interface{}, *PID) + func UnwrapEnvelopeMessage(message interface{}) interface + type Actor interface + Receive func(c Context) + type ActorProcess struct + func NewActorProcess(mailbox Mailbox) *ActorProcess + func (ref *ActorProcess) SendSystemMessage(_ *PID, message interface{}) + func (ref *ActorProcess) SendUserMessage(_ *PID, message interface{}) + func (ref *ActorProcess) Stop(pid *PID) + type ActorSystem struct + Config *Config + DeadLetter *deadLetterProcess + EventStream *eventstream.EventStream + Extensions *extensions.Extensions + Guardians *guardiansValue + ID string + ProcessRegistry *ProcessRegistryValue + Root *RootContext + func NewActorSystem(options ...ConfigOption) *ActorSystem + func NewActorSystemWithConfig(config *Config) *ActorSystem + func (as *ActorSystem) Address() string + func (as *ActorSystem) GetHostPort() (host string, port int, err error) + func (as *ActorSystem) IsStopped() bool + func (as *ActorSystem) Logger() *slog.Logger + func (as *ActorSystem) NewLocalPID(id string) *PID + func (as *ActorSystem) Shutdown() + type AddressResolver func(*PID) (Process, bool) + type AutoReceiveMessage interface + AutoReceiveMessage func() + type AutoRespond interface + GetAutoResponse func(context Context) interface{} + type Behavior []ReceiveFunc + func NewBehavior() Behavior + func (b *Behavior) Become(receive ReceiveFunc) + func (b *Behavior) BecomeStacked(receive ReceiveFunc) + func (b *Behavior) Receive(context Context) + func (b *Behavior) UnbecomeStacked() + type Config struct + DeadLetterRequestLogging bool + DeadLetterThrottleCount int32 + DeadLetterThrottleInterval time.Duration + DeveloperSupervisionLogging bool + DiagnosticsSerializer func(Actor) string + LoggerFactory func(system *ActorSystem) *slog.Logger + MetricsProvider metric.MeterProvider + func Configure(options ...ConfigOption) *Config + func NewConfig() *Config + type ConfigOption func(config *Config) + func WithDeadLetterRequestLogging(enabled bool) ConfigOption + func WithDeadLetterThrottleCount(count int32) ConfigOption + func WithDeadLetterThrottleInterval(duration time.Duration) ConfigOption + func WithDefaultPrometheusProvider(port ...int) ConfigOption + func WithDeveloperSupervisionLogging(enabled bool) ConfigOption + func WithDiagnosticsSerializer(serializer func(Actor) string) ConfigOption + func WithLoggerFactory(factory func(system *ActorSystem) *slog.Logger) ConfigOption + func WithMetricProviders(provider metric.MeterProvider) ConfigOption + type Context interface + type ContextDecorator func(next ContextDecoratorFunc) ContextDecoratorFunc + type ContextDecoratorFunc func(ctx Context) Context + type DeadLetterEvent struct + Message interface{} + PID *PID + Sender *PID + type DeadLetterResponse struct + Target *PID + func (*DeadLetterResponse) Descriptor() ([]byte, []int) + func (*DeadLetterResponse) ProtoMessage() + func (x *DeadLetterResponse) GetTarget() *PID + func (x *DeadLetterResponse) ProtoReflect() protoreflect.Message + func (x *DeadLetterResponse) Reset() + func (x *DeadLetterResponse) String() string + type DeciderFunc func(reason interface{}) Directive + type Directive int + const EscalateDirective + const RestartDirective + const ResumeDirective + const StopDirective + func DefaultDecider(_ interface{}) Directive + func (i Directive) String() string + type Dispatcher interface + Schedule func(fn func()) + Throughput func() int + func NewDefaultDispatcher(throughput int) Dispatcher + func NewSynchronizedDispatcher(throughput int) Dispatcher + type EventStreamProcess struct + func NewEventStreamProcess(actorSystem *ActorSystem) *EventStreamProcess + func (e *EventStreamProcess) SendSystemMessage(_ *PID, _ interface{}) + func (e *EventStreamProcess) SendUserMessage(_ *PID, message interface{}) + func (e *EventStreamProcess) Stop(_ *PID) + type ExtensionContext interface + type Failure struct + Message interface{} + Reason interface{} + RestartStats *RestartStatistics + Who *PID + func (*Failure) SystemMessage() + type Future struct + func NewFuture(actorSystem *ActorSystem, d time.Duration) *Future + func (f *Future) PID() *PID + func (f *Future) PipeTo(pids ...*PID) + func (f *Future) Result() (interface{}, error) + func (f *Future) Wait() error + type IgnoreDeadLetterLogging interface + IgnoreDeadLetterLogging func() + type InfrastructureMessage interface + InfrastructureMessage func() + type Mailbox interface + PostSystemMessage func(message interface{}) + PostUserMessage func(message interface{}) + RegisterHandlers func(invoker MessageInvoker, dispatcher Dispatcher) + Start func() + UserMessageCount func() int + type MailboxMessage interface + MailboxMessage func() + type MailboxMiddleware interface + MailboxEmpty func() + MailboxStarted func() + MessagePosted func(message interface{}) + MessageReceived func(message interface{}) + type MailboxProducer func() Mailbox + func Bounded(size int, mailboxStats ...MailboxMiddleware) MailboxProducer + func BoundedDropping(size int, mailboxStats ...MailboxMiddleware) MailboxProducer + func Unbounded(mailboxStats ...MailboxMiddleware) MailboxProducer + func UnboundedLockfree(mailboxStats ...MailboxMiddleware) MailboxProducer + func UnboundedPriority(mailboxStats ...MailboxMiddleware) MailboxProducer + func UnboundedPriorityMpsc(mailboxStats ...MailboxMiddleware) MailboxProducer + type MessageBatch interface + GetMessages func() []interface{} + type MessageEnvelope struct + Header messageHeader + Message interface{} + Sender *PID + func WrapEnvelope(message interface{}) *MessageEnvelope + func (envelope *MessageEnvelope) GetHeader(key string) string + func (envelope *MessageEnvelope) SetHeader(key string, value string) + type MessageInvoker interface + EscalateFailure func(reason interface{}, message interface{}) + InvokeSystemMessage func(interface{}) + InvokeUserMessage func(interface{}) + type Metrics struct + func NewMetrics(system *ActorSystem, provider metric.MeterProvider) *Metrics + func (m *Metrics) CommonLabels(ctx Context) []attribute.KeyValue + func (m *Metrics) Enabled() bool + func (m *Metrics) ExtensionID() extensions.ExtensionID + func (m *Metrics) PrepareMailboxLengthGauge() + type NotInfluenceReceiveTimeout interface + NotInfluenceReceiveTimeout func() + type PID struct + Address string + Id string + RequestId uint32 + func NewPID(address, id string) *PID + func UnwrapEnvelopeSender(message interface{}) *PID + func (*PID) Descriptor() ([]byte, []int) + func (*PID) ProtoMessage() + func (pid *PID) Equal(other *PID) bool + func (x *PID) GetAddress() string + func (x *PID) GetId() string + func (x *PID) GetRequestId() uint32 + func (x *PID) ProtoReflect() protoreflect.Message + func (x *PID) Reset() + func (x *PID) String() string + type PIDSet struct + func NewPIDSet(pids ...*PID) *PIDSet + func (p *PIDSet) Add(v *PID) + func (p *PIDSet) Clear() + func (p *PIDSet) Clone() *PIDSet + func (p *PIDSet) Contains(v *PID) bool + func (p *PIDSet) Empty() bool + func (p *PIDSet) ForEach(f func(i int, pid *PID)) + func (p *PIDSet) Get(index int) *PID + func (p *PIDSet) Len() int + func (p *PIDSet) Remove(v *PID) bool + func (p *PIDSet) Values() []*PID + type PoisonPill struct + func (*PoisonPill) AutoReceiveMessage() + func (*PoisonPill) Descriptor() ([]byte, []int) + func (*PoisonPill) ProtoMessage() + func (x *PoisonPill) ProtoReflect() protoreflect.Message + func (x *PoisonPill) Reset() + func (x *PoisonPill) String() string + type PriorityMessage interface + GetPriority func() int8 + type Process interface + SendSystemMessage func(pid *PID, message interface{}) + SendUserMessage func(pid *PID, message interface{}) + Stop func(pid *PID) + type ProcessRegistryValue struct + ActorSystem *ActorSystem + Address string + LocalPIDs *SliceMap + RemoteHandlers []AddressResolver + SequenceID uint64 + func NewProcessRegistry(actorSystem *ActorSystem) *ProcessRegistryValue + func (pr *ProcessRegistryValue) Add(process Process, id string) (*PID, bool) + func (pr *ProcessRegistryValue) Get(pid *PID) (Process, bool) + func (pr *ProcessRegistryValue) GetLocal(id string) (Process, bool) + func (pr *ProcessRegistryValue) NextId() string + func (pr *ProcessRegistryValue) RegisterAddressResolver(handler AddressResolver) + func (pr *ProcessRegistryValue) Remove(pid *PID) + type Producer func() Actor + type ProducerWithActorSystem func(system *ActorSystem) Actor + type Props struct + func PropsFromFunc(f ReceiveFunc, opts ...PropsOption) *Props + func PropsFromProducer(producer Producer, opts ...PropsOption) *Props + func PropsFromProducerWithActorSystem(producer ProducerWithActorSystem, opts ...PropsOption) *Props + func (props *Props) Clone(opts ...PropsOption) *Props + func (props *Props) Configure(opts ...PropsOption) *Props + type PropsOption func(props *Props) + func WithContextDecorator(contextDecorator ...ContextDecorator) PropsOption + func WithDispatcher(dispatcher Dispatcher) PropsOption + func WithFunc(f ReceiveFunc) PropsOption + func WithGuardian(guardian SupervisorStrategy) PropsOption + func WithMailbox(mailbox MailboxProducer) PropsOption + func WithOnInit(init ...func(ctx Context)) PropsOption + func WithProducer(p Producer) PropsOption + func WithReceiverMiddleware(middleware ...ReceiverMiddleware) PropsOption + func WithSenderMiddleware(middleware ...SenderMiddleware) PropsOption + func WithSpawnFunc(spawn SpawnFunc) PropsOption + func WithSpawnMiddleware(middleware ...SpawnMiddleware) PropsOption + func WithSupervisor(supervisor SupervisorStrategy) PropsOption + type ReadonlyMessageHeader interface + Get func(key string) string + Keys func() []string + Length func() int + ToMap func() map[string]string + func UnwrapEnvelopeHeader(message interface{}) ReadonlyMessageHeader + type ReceiveFunc func(c Context) + func (f ReceiveFunc) Receive(c Context) + type ReceiveTimeout struct + type ReceiverContext interface + type ReceiverFunc func(c ReceiverContext, envelope *MessageEnvelope) + type ReceiverMiddleware func(next ReceiverFunc) ReceiverFunc + type Restart struct + func (*Restart) SystemMessage() + type RestartStatistics struct + func NewRestartStatistics() *RestartStatistics + func (rs *RestartStatistics) Fail() + func (rs *RestartStatistics) FailureCount() int + func (rs *RestartStatistics) NumberOfFailures(withinDuration time.Duration) int + func (rs *RestartStatistics) Reset() + type Restarting struct + func (*Restarting) AutoReceiveMessage() + type ResumeMailbox struct + func (*ResumeMailbox) MailboxMessage() + type RootContext struct + func NewRootContext(actorSystem *ActorSystem, header map[string]string, ...) *RootContext + func (rc *RootContext) Actor() Actor + func (rc *RootContext) ActorSystem() *ActorSystem + func (rc *RootContext) Logger() *slog.Logger + func (rc *RootContext) Message() interface{} + func (rc *RootContext) MessageHeader() ReadonlyMessageHeader + func (rc *RootContext) Parent() *PID + func (rc *RootContext) Poison(pid *PID) + func (rc *RootContext) PoisonFuture(pid *PID) *Future + func (rc *RootContext) Request(pid *PID, message interface{}) + func (rc *RootContext) RequestFuture(pid *PID, message interface{}, timeout time.Duration) *Future + func (rc *RootContext) RequestWithCustomSender(pid *PID, message interface{}, sender *PID) + func (rc *RootContext) Self() *PID + func (rc *RootContext) Send(pid *PID, message interface{}) + func (rc *RootContext) Sender() *PID + func (rc *RootContext) Spawn(props *Props) *PID + func (rc *RootContext) SpawnNamed(props *Props, name string) (*PID, error) + func (rc *RootContext) SpawnPrefix(props *Props, prefix string) *PID + func (rc *RootContext) Stop(pid *PID) + func (rc *RootContext) StopFuture(pid *PID) *Future + func (rc *RootContext) WithGuardian(guardian SupervisorStrategy) *RootContext + func (rc *RootContext) WithHeaders(headers map[string]string) *RootContext + func (rc *RootContext) WithSenderMiddleware(middleware ...SenderMiddleware) *RootContext + func (rc *RootContext) WithSpawnMiddleware(middleware ...SpawnMiddleware) *RootContext + func (rc RootContext) Copy() *RootContext + type SenderContext interface + type SenderFunc func(c SenderContext, target *PID, envelope *MessageEnvelope) + type SenderMiddleware func(next SenderFunc) SenderFunc + type ShouldThrottle func() Valve + func NewThrottle(maxEventsInPeriod int32, period time.Duration, throttledCallBack func(int32)) ShouldThrottle + func NewThrottleWithLogger(logger *slog.Logger, maxEventsInPeriod int32, period time.Duration, ...) ShouldThrottle + type SliceMap struct + LocalPIDs []cmap.ConcurrentMap + func (s *SliceMap) GetBucket(key string) cmap.ConcurrentMap + type SpawnFunc func(actorSystem *ActorSystem, id string, props *Props, ...) (*PID, error) + var DefaultSpawner SpawnFunc = defaultSpawner + type SpawnMiddleware func(next SpawnFunc) SpawnFunc + type SpawnerContext interface + type Started struct + func (*Started) SystemMessage() + type Stop struct + func (*Stop) Descriptor() ([]byte, []int) + func (*Stop) ProtoMessage() + func (*Stop) SystemMessage() + func (x *Stop) ProtoReflect() protoreflect.Message + func (x *Stop) Reset() + func (x *Stop) String() string + type Stopped struct + func (*Stopped) AutoReceiveMessage() + type Stopping struct + func (*Stopping) AutoReceiveMessage() + type Supervisor interface + Children func() []*PID + EscalateFailure func(reason interface{}, message interface{}) + RestartChildren func(pids ...*PID) + ResumeChildren func(pids ...*PID) + StopChildren func(pids ...*PID) + type SupervisorEvent struct + Child *PID + Directive Directive + Reason interface{} + type SupervisorStrategy interface + HandleFailure func(actorSystem *ActorSystem, supervisor Supervisor, child *PID, ...) + func DefaultSupervisorStrategy() SupervisorStrategy + func NewAllForOneStrategy(maxNrOfRetries int, withinDuration time.Duration, decider DeciderFunc) SupervisorStrategy + func NewExponentialBackoffStrategy(backoffWindow time.Duration, initialBackoff time.Duration) SupervisorStrategy + func NewOneForOneStrategy(maxNrOfRetries int, withinDuration time.Duration, decider DeciderFunc) SupervisorStrategy + func NewRestartingStrategy() SupervisorStrategy + func RestartingSupervisorStrategy() SupervisorStrategy + type SuspendMailbox struct + func (*SuspendMailbox) MailboxMessage() + type SystemMessage interface + SystemMessage func() + type Terminated struct + Who *PID + Why TerminatedReason + func (*Terminated) Descriptor() ([]byte, []int) + func (*Terminated) ProtoMessage() + func (*Terminated) SystemMessage() + func (x *Terminated) GetWho() *PID + func (x *Terminated) GetWhy() TerminatedReason + func (x *Terminated) ProtoReflect() protoreflect.Message + func (x *Terminated) Reset() + func (x *Terminated) String() string + type TerminatedReason int32 + const TerminatedReason_AddressTerminated + const TerminatedReason_NotFound + const TerminatedReason_Stopped + func (TerminatedReason) Descriptor() protoreflect.EnumDescriptor + func (TerminatedReason) EnumDescriptor() ([]byte, []int) + func (TerminatedReason) Type() protoreflect.EnumType + func (x TerminatedReason) Enum() *TerminatedReason + func (x TerminatedReason) Number() protoreflect.EnumNumber + func (x TerminatedReason) String() string + type Touch struct + func (*Touch) Descriptor() ([]byte, []int) + func (*Touch) GetAutoResponse(ctx Context) interface{} + func (*Touch) ProtoMessage() + func (x *Touch) ProtoReflect() protoreflect.Message + func (x *Touch) Reset() + func (x *Touch) String() string + type Touched struct + Who *PID + func (*Touched) Descriptor() ([]byte, []int) + func (*Touched) ProtoMessage() + func (x *Touched) GetWho() *PID + func (x *Touched) ProtoReflect() protoreflect.Message + func (x *Touched) Reset() + func (x *Touched) String() string + type Unwatch struct + Watcher *PID + func (*Unwatch) Descriptor() ([]byte, []int) + func (*Unwatch) ProtoMessage() + func (*Unwatch) SystemMessage() + func (x *Unwatch) GetWatcher() *PID + func (x *Unwatch) ProtoReflect() protoreflect.Message + func (x *Unwatch) Reset() + func (x *Unwatch) String() string + type Valve int32 + const Closed + const Closing + const Open + type Watch struct + Watcher *PID + func (*Watch) Descriptor() ([]byte, []int) + func (*Watch) ProtoMessage() + func (*Watch) SystemMessage() + func (x *Watch) GetWatcher() *PID + func (x *Watch) ProtoReflect() protoreflect.Message + func (x *Watch) Reset() + func (x *Watch) String() string