- 
                Notifications
    You must be signed in to change notification settings 
- Fork 5
Description
Specification
We'd like to investigate creating our own locking library, based off our current usage of fd-lock.
Previously we were using both proper-lockfile and fd-lock in a more conglomerated fashion. Now, we are purely using fd-lock for the Status (our refactored agent lockfile #283) and Session usage (implemented here).
Note the distinction between "locking" here. Here, we're referring to "file locking" (as per the fd prefix). For example, for the Status, we lock this status file to assert that an agent process is currently executing. Conversely, we're using async-mutex for intra-process locking (locking some resource from within a process, as opposed to between processes). Remember that we also have an existing read-write locking implementation that utilises async-mutex.
Our own library should support:
- OS-specific read-write locks
- Native promise API
- Explore the addition of POSIX locks
OS-specific read-write locks should be the initial priority, and should be seen as a basic extension of functionality from fd-lock (we can use this as a source of inspiration to copy from).
Additional context
- Original issue: Unify File Locking Across Domains #251
- Coalesce concurrent locking when writing the session token during GRPC requests Polykey-CLI#18 - Should also allow an API to check if the lock is already locked so we can enable concurrent coalescing
Tasks
- ...
- ...
- ...