const task = new Task.Simple();
task.setHandler((ctx) => {
// doing something
});
task.run();
const task = new Task.Batch({ size: 10 });
task.setHandler((ctx) => {
// doing something
});
task.readFrom(() => {}); // should return a read buffer
task.run();
SQL:
const task = new Task.Batch({ size: 10 });
task.setHandler((ctx) => {
// doing something
});
task.readFromSql('SELECT * FROM table'); // invoke on the base of "task.readFrom"
task.run();
CSV:
const task = new Task.Batch({ size: 10 });
task.setHandler((ctx) => {
// doing something
});
task.readFromCsv('./records.csv'); // invoke on the base of "task.readFrom"
task.run();