RedMutex v0.1.0 RedMutex behaviour View Source
defmodule MyMutex do
use RedMutex, otp_app: :my_app
end
config :my_app, MyMutex,
redis_url: "redis://redix.example.com:6380",
key: "something"
{:ok, mutex} = MyMutex.lock(12)
true = MyMutex.locked?
:ok = MyMutex.unlock(mutex)
import MyMutex, only: [synchronize: 1]
synchronize do
// work
end
Link to this section Summary
Link to this section Types
Link to this type
callback() View Source
Link to this type
mutex()
View Source
mutex()
View Source
mutex() :: String.t()
mutex() :: String.t()
Link to this type
reason()
View Source
reason()
View Source
reason() :: any()
reason() :: any()
Link to this section Callbacks
Link to this callback
exists_lock() View Source
Link to this callback
lock() View Source
Link to this callback
synchronize(callback) View Source
Link to this callback