abstract class Movie::Extension

Overview

Base class for ActorSystem extensions. Extensions provide additional functionality to the actor system (e.g., remoting, clustering, persistence, metrics).

Extensions are:

Example: class MyExtension < Movie::Extension def initialize(@system : Movie::AbstractActorSystem) end

def start
  # Initialize extension
end

def stop
  # Cleanup resources
end

end

Register and use

ext = MyExtension.new(system) system.register_extension(ext) system.extension(MyExtension) # => MyExtension instance

Akka-style access with ExtensionId:

class MyExtId < Movie::ExtensionId(MyExtension) def create(system : Movie::AbstractActorSystem) MyExtension.new(system) end end

MyExtId.get(system) # => MyExtension instance

Direct Known Subclasses

Defined in:

movie.cr

Instance Method Summary

Instance Method Detail

def start #

Called when the extension is registered with the system. Override to perform initialization.


[View source]
abstract def stop #

Called when the system is shutting down. Override to cleanup resources (close connections, stop services, etc.)


[View source]