Skip to content

WIP: ✨ Restrict running sessions to one concurrent one#182

Closed
a-kenji wants to merge 5 commits intomainfrom
feat/lock
Closed

WIP: ✨ Restrict running sessions to one concurrent one#182
a-kenji wants to merge 5 commits intomainfrom
feat/lock

Conversation

@a-kenji
Copy link
Collaborator

@a-kenji a-kenji commented Aug 22, 2024

This restricts the sessions that are allowed in parallel to one.

TODO:

  • If centerpiece is interrupted by ctrl-c in the terminal, currently the lockfile will not be cleaned up.
  • Use fs4 to hold exclusive lock

This restricts the sessions that are allowed in parallel to one.TODO:
Find a good way to drop the lock on destruction.
a-kenji added a commit that referenced this pull request Feb 5, 2026
Restrict running sessions to one concurrent one.
Uses the `XDG_RUNTIME_DIR` to hold an exclusive runtime lock.
The lock is automatically cleaned up upon exit.
Falls back gracefully, if the variable is not set.

An earlier implementation used the `fs4` crate, but
now this functionality is in the `stdlib` since `rustc --version`: `1.89.0`.

Closes: #179
Supercedes: #182
@a-kenji
Copy link
Collaborator Author

a-kenji commented Feb 5, 2026

Superceded by: #258

@a-kenji a-kenji closed this Feb 5, 2026
a-kenji added a commit that referenced this pull request Feb 5, 2026
Restrict running sessions to one concurrent one.
Uses the `XDG_RUNTIME_DIR` to hold an exclusive runtime lock.
The lock is automatically cleaned up upon exit.

An earlier implementation used the `fs4` crate, but
now this functionality is in the `stdlib` since `rustc --version`: `1.89.0`.

Closes: #179
Supercedes: #182
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant