Initial commit: igny8 project

This commit is contained in:
igny8
2025-11-09 10:27:02 +00:00
commit 60b8188111
27265 changed files with 4360521 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
import { RawTask } from './RawTask.js'
import type { Task } from './types.js'
export class TaskFactory {
private freeTasks: RawTask[] = []
public constructor(private onError: (err: any) => void) {}
public create(task: () => void): Task {
const tasks = this.freeTasks
const t = tasks.length
? (tasks.pop() as RawTask)
: new RawTask(this.onError, (t) => (tasks[tasks.length] = t))
t.task = task
return t
}
}