module
Prostore::Migration::Lease
Overview
Lease-based mutex for migrations (ADR-0009 invariant 5).
Extended Modules
Defined in:
prostore/migration/lease.crConstant Summary
-
DEFAULT_DURATION =
5.minutes
Instance Method Summary
-
#claim(adapter, executor : Adapter::Base::Executor, migration_id : Int64, runner_id : String, duration : Time::Span = DEFAULT_DURATION) : Bool
Returns true if the lease was successfully claimed; false if another live lease is held.
- #heartbeat(adapter, executor : Adapter::Base::Executor, migration_id : Int64, runner_id : String, duration : Time::Span = DEFAULT_DURATION) : Bool
- #release(adapter, executor : Adapter::Base::Executor, migration_id : Int64, runner_id : String) : Nil
- #runner_id : String
Instance Method Detail
def claim(adapter, executor : Adapter::Base::Executor, migration_id : Int64, runner_id : String, duration : Time::Span = DEFAULT_DURATION) : Bool
#
Returns true if the lease was successfully claimed; false if another live lease is held.
def heartbeat(adapter, executor : Adapter::Base::Executor, migration_id : Int64, runner_id : String, duration : Time::Span = DEFAULT_DURATION) : Bool
#
def release(adapter, executor : Adapter::Base::Executor, migration_id : Int64, runner_id : String) : Nil
#