🎭
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
  • Overview
  • Get Started
  • Example

Extensions

PreviousCluster PubSubNextDependencies

Last updated 29 days ago

Overview

Extension defines a pluggable interface that can be injected into the ActorSystem to extend its core functionality with custom or domain-specific behaviour.

Extensions provide a powerful mechanism to augment the actor system with capabilities not available out-of-the-box—such as support for event sourcing, metrics, and many more or dependency injection.

Once registered, an Extension becomes accessible from any actor's message context, making it easy to share cross-cutting concerns across the system.

Get Started

  1. Implement the interface.

  2. Register the extension when creating the actor system using the option.

Once the above steps completed, you can always access the list of extensions of a given extension whenever handling a message using the following methods of the ReceiveContext

  • - this returns the list of all extensions registered within the ActorSystem .

  • - retrieves a specific extension registered in the ActorSystem by its unique ID.

Example

A good example can be found .

Extension
WithExtensions
Extensions
Extension(extensionID string)
here