The type of the task worker parameters.
The type of the task worker result.
Use to define a group task configuration.
const dataGetterConfig: GroupTaskConfigI<[url: string], Promise<JSON>> = {
mode: "parallel", // or "series"
subTasks: [txtDataGetterTask, audioDataGetterTask, booksGetterGroupTask],
};
Other valid configurations.
// with optional worker function
const dataGetterConfig: GroupTaskConfigI<[url: string], Promise<JSON>> = {
mode: "parallel", // or "series"
subTasks: [txtDataGetterTask, audioDataGetterTask, booksGetterGroupTask],
worker: async (url) => {
const response = await fetch(url);
const movies = await response.json();
return movies;
};
};
// with optional worker parameters
const dataGetterConfig: GroupTaskConfigI<[url: string], Promise<JSON>> = {
mode: "parallel", // or "series"
subTasks: [txtDataGetterTask, audioDataGetterTask, booksGetterGroupTask],
workerParams: ["example.com"]
};
// with both optional worker function and worker parameters
const dataGetterConfig: GroupTaskConfigI<[url: string], Promise<JSON>> = {
mode: "parallel", // or "series"
subTasks: [txtDataGetterTask, audioDataGetterTask, booksGetterGroupTask],
worker: async (url) => {
const response = await fetch(url);
const movies = await response.json();
return movies;
};
workerParams: ["example.com"]
};
Generated using TypeDoc
The interface of the configuration options for a group task.