This pull request introduces a distributed mutex implementation using Redis for Sequin. The changes include:
A new Sequin.Mutex module that provides functions to acquire, touch, and release mutexes using Redis.
A Sequin.MutexOwner GenStateMachine that manages mutex acquisition and maintenance, with callbacks for successful acquisition.
A Sequin.MutexedSupervisor that ensures only one instance of child processes is running at a time across distributed nodes.
The implementation uses Redix for Redis communication and includes error handling for Redis connection issues. The MutexOwner periodically touches the mutex to maintain ownership and crashes if the mutex is unexpectedly lost.
The MutexedSupervisor uses a one-for-all strategy, ensuring that if the MutexOwner loses its mutex, all child processes are shut down as well.
Additionally, the gen_state_machine dependency has been added to the project's mix file to support the new GenStateMachine implementation.
This pull request introduces a distributed mutex implementation using Redis for Sequin. The changes include:
A new
Sequin.Mutex
module that provides functions to acquire, touch, and release mutexes using Redis.A
Sequin.MutexOwner
GenStateMachine that manages mutex acquisition and maintenance, with callbacks for successful acquisition.A
Sequin.MutexedSupervisor
that ensures only one instance of child processes is running at a time across distributed nodes.The implementation uses Redix for Redis communication and includes error handling for Redis connection issues. The MutexOwner periodically touches the mutex to maintain ownership and crashes if the mutex is unexpectedly lost.
The MutexedSupervisor uses a one-for-all strategy, ensuring that if the MutexOwner loses its mutex, all child processes are shut down as well.
Additionally, the
gen_state_machine
dependency has been added to the project's mix file to support the new GenStateMachine implementation.