class Movie::ExecutorExtension

Overview

Generic executor extension — runs arbitrary tasks on a bounded pool of workers.

Defined in:

movie/executor.cr

Constructors

Instance Method Summary

Instance methods inherited from class Movie::Extension

start start, stop stop

Constructor Detail

def self.new(system : AbstractActorSystem, pool_size : Int32 = 4, queue_capacity : Int32 = 128) #

[View source]

Instance Method Detail

def execute(timeout : Time::Span | Nil = nil, &block : -> T) : Future(T) forall T #

Execute a block and return a Future (existing API).


[View source]
def execute_with_reply(reply_to : ActorRef(TaskReply(T)), timeout : Time::Span | Nil = nil, &block : -> T) : Nil forall T #

Execute a block and send the result back to a specific actor via a message.


[View source]
def start #
Description copied from class Movie::Extension

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


[View source]
def stop #
Description copied from class Movie::Extension

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


[View source]