Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor!(daemon): Rename mutex to serial-jobs #2131

Merged
merged 1 commit into from
Mar 12, 2024
Merged

Conversation

rekmarks
Copy link
Contributor

@rekmarks rekmarks commented Mar 9, 2024

Renames the daemon's Mutex to SerialJobs, which better reflects its purpose. Also removes lock() and unlock() from its interface.

@rekmarks rekmarks force-pushed the rekmarks-mutex-queue branch 5 times, most recently from f0ebab9 to ae08483 Compare March 9, 2024 20:47
@kriskowal
Copy link
Member

I’m not quite satisfied. This is something that might graduate to @endo/promise-kit someday, a pair of “builder objects” for parallel and serial aggregate jobs. Consider SerialJobs vs ParallelJobs.

Here’s an animation monad library for a game I wrote once that had analogous primitives: https://github.com/kriskowal/peruacru/blob/master/animation.js#L119-L130 The meaningful difference is that animations get scheduled when JavaScript yields to the browser’s outer render loop, so unlike promises, this is a strict monad (no auto-unwrap) and it’s synchronous. It is analogous to promises in many other ways.

Renames the daemon's `Mutex` to `SerialJobs`, which better reflects its
purpose. Also removes `lock()` and `unlock()` from its interface.
@rekmarks rekmarks force-pushed the rekmarks-mutex-queue branch from ae08483 to d7951b0 Compare March 12, 2024 16:35
@rekmarks rekmarks changed the title refactor!(daemon): Rename mutex to mutex-queue refactor!(daemon): Rename mutex to serial-jobs Mar 12, 2024
@rekmarks rekmarks merged commit 5186a50 into master Mar 12, 2024
14 checks passed
@rekmarks rekmarks deleted the rekmarks-mutex-queue branch March 12, 2024 17:44
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.

2 participants