BlogEngine.Locks (blog_engine v0.1.0)

Copy Markdown View Source

Row locks shared by the route registry and the routing lifecycle.

Summary

Functions

Locks one tenant blog row FOR UPDATE, returning nil when it is absent.

Locks one tenant post row within its blog FOR UPDATE, returning nil when it is absent.

Functions

lock_blog(repo, context, blog_id)

@spec lock_blog(module(), BlogEngine.Context.t(), Ecto.UUID.t()) ::
  BlogEngine.Schema.Blog.t() | nil

Locks one tenant blog row FOR UPDATE, returning nil when it is absent.

lock_post(repo, context, post_id, blog_id)

Locks one tenant post row within its blog FOR UPDATE, returning nil when it is absent.