luckyframework / luckyframework/avram
Advisory Locks
Nobody has claimed this yet.
- Dominant language
- Crystal
- Stars
- 183
- Forks
- 67
- PR merge metrics
- No merged PRs in 30d
Description
I've been using the gem [with_advisory_lock](https://github.com/ClosureTree/with_advisory_lock) quite a bit recently in a ruby codebase. The locks are not connected to any table or row and work ok for certain needs in an application.. Maybe we can do something with this in Avram?
Note: I believe rails has some advisory lock functionality built in, but the gem implements polling logic to avoid hanging up the thread for too long. I'm not sure what else it does or if we'd need to consider that. It also has built in config to disable the query cache because updates could happen to the database while waiting for the lock.
https://www.postgresql.org/docs/current/explicit-locking.html#ADVISORY-LOCKS
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue names no Avram files, tests, or entry points. Start by reviewing Avram's database-locking APIs, the with_advisory_lock gem, and PostgreSQL's advisory-lock documentation. The desired API, polling behavior, query-cache handling, and completion criteria still need to be defined.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- crystal, postgresql
- Domain
- databases
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100