- Add Activepieces fork with SmoothSchedule custom piece - Create integrations app with Activepieces service layer - Add embed token endpoint for iframe integration - Create Automations page with embedded workflow builder - Add sidebar visibility fix for embed mode - Add list inactive customers endpoint to Public API - Include SmoothSchedule triggers: event created/updated/cancelled - Include SmoothSchedule actions: create/update/cancel events, list resources/services/customers 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
30 lines
545 B
TypeScript
30 lines
545 B
TypeScript
import { Mutex } from 'async-mutex';
|
|
|
|
export class PromiseQueue {
|
|
private queue: (() => Promise<unknown>)[] = [];
|
|
private lock: Mutex = new Mutex();
|
|
private halted = false;
|
|
|
|
add(promise: () => Promise<unknown>) {
|
|
this.queue.push(promise);
|
|
this.run();
|
|
}
|
|
|
|
halt() {
|
|
this.halted = true;
|
|
}
|
|
size() {
|
|
return this.queue.length;
|
|
}
|
|
|
|
private run() {
|
|
this.lock.runExclusive(async () => {
|
|
const promise = this.queue.shift()!;
|
|
if (this.halted) {
|
|
return;
|
|
}
|
|
await promise();
|
|
});
|
|
}
|
|
}
|