Skip to content

Create IPC locking library @matrixai/js-file-locks to introduce RWlocks in IPC #290

@joshuakarp

Description

@joshuakarp

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

Tasks

  1. ...
  2. ...
  3. ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions