🎭
GoAkt
GithubReference
  • 👋Introduction
  • 🏛️Design Principles
  • 🔢Versioning
  • 💡Use Cases
  • 🚀Get Started
  • 📦Binaries and Go versions
  • features
    • Actor System
    • Actor
    • Mailbox
    • Messaging
    • PipeTo
    • Passivation
    • Supervision
    • Behaviors
    • Remoting and APIs
    • TLS
    • Scheduler
    • Stashing
    • Routers
    • Events Stream
    • Coordinated Shutdown
    • Persistence
    • Observability
    • Testkit
    • Cluster
    • Service Discovery
    • Cluster Singleton
    • Cluster Client
  • Cluster PubSub
  • Extensions
  • Dependencies
  • Meta Framework
    • eGo
Powered by GitBook
On this page
  1. features

Behaviors

PreviousSupervisionNextRemoting and APIs

Last updated 3 months ago

Actors in GoAkt have the power to switch their behaviors at any point in time. When you change the actor behavior, the new behavior will take effect for all subsequent messages until the behavior is changed again. The current message will continue processing with the existing behavior. You can use Stashing to reprocess the current message with the new behavior. See Stashing

To change the behavior, call the following methods on the when handling a message:

  • Become - switches the current behavior of the actor to a new behavior.

  • UnBecome - resets the actor behavior to the default one which is the Actor.Receive method.

  • BecomeStacked - sets a new behavior to the actor to the top of the behavior stack, while maintaining the previous ones.

  • UnBecomeStacked() - sets the actor behavior to the previous behavior before BecomeStacked() was called. This only works with BecomeStacked().

ReceiveContext interface