UNPKG

torotask

Version:

Task queue processing in NodeJS based on BullMQ and Redis

24 lines 744 B
/** * Helper type to get strongly-typed task groups from a TaskServer instance * based on the task group definitions used to initialize it. * * @example * ``` * const taskGroupDefs = { * groupA: { name: 'groupA', definitions: { ... } }, * groupB: { name: 'groupB', definitions: { ... } } * } as const; * * const server = new TaskServer({ taskGroupDefinitions: taskGroupDefs }); * * // Get strongly-typed task groups * const groups = getTypedTaskGroups<typeof taskGroupDefs>(server); * * // Now you have type-safe access to task groups and their tasks * const taskA = groups.groupA.tasks.taskA; * ``` */ export function getTypedTaskGroups(server) { return server.taskGroups; } //# sourceMappingURL=server-helper.js.map