class Movie::DatabaseExtension

Overview

Database extension that manages connection pool actors.

Defined in:

movie/persistence/behaviors.cr

Constructors

Instance Method Summary

Instance methods inherited from class Movie::Extension

start start, stop stop

Constructor Detail

def self.new(system : AbstractActorSystem, backend : Persistence::Backend, pool_size : Int32, queue_capacity : Int32, operation_timeout : Time::Span, resilience : Persistence::ResiliencePolicy = Persistence::ResiliencePolicy.disabled) #

[View source]

Instance Method Detail

def acknowledge_outbox(owner : String, message_ids : Array(String)) : Int64 #

[View source]
def acquire_shard_lease(key : Persistence::ShardLeaseKey, owner : String, lease : Time::Span) : Persistence::ShardLeaseToken | Nil #

[View source]
def backend_name : String #

[View source]
def claim_outbox(owner : String, limit : Int32 = 100, lease : Time::Span = 30.seconds) : Array(Persistence::StoredOutboxEntry) #

[View source]
def delete_events_to(persistence_id : String, sequence_nr : Int64) : Persistence::RetentionResult #

[View source]
def delete_projection_offset(name : String) : Bool #

[View source]

[View source]

[View source]
def operation_timeout : Time::Span #

[View source]

[View source]
def projection_offset(name : String) : Int64 #

[View source]
def query_events(after_offset : Int64 = 0_i64, limit : Int32 = 100, persistence_id : String | Nil = nil) : Persistence::EventPage #

[View source]

Performs an active backend/schema probe. Unlike #health, this can block for the configured operation timeout and reports connection failures in the returned snapshot instead of raising them.


[View source]
def release_outbox(owner : String, message_id : String, error : String) : Bool #

[View source]
def release_shard_lease(token : Persistence::ShardLeaseToken) : Bool #

[View source]
def renew_shard_lease(token : Persistence::ShardLeaseToken, lease : Time::Span) : Persistence::ShardLeaseToken | Nil #

[View source]
def run_maintenance : Persistence::MaintenanceResult #

[View source]
def save_projection_offset(name : String, offset : Int64) : Int64 #

[View source]
def schema_version : Int64 #

[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]
def telemetry : Persistence::Telemetry #

[View source]