mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-15 20:17:22 +00:00
public commit
This commit is contained in:
18
app/__test__/flows/inc/simple-fetch.ts
Normal file
18
app/__test__/flows/inc/simple-fetch.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import { FetchTask, Flow, LogTask } from "../../../src/flows";
|
||||
|
||||
const first = new LogTask("First", { delay: 1000 });
|
||||
const second = new LogTask("Second", { delay: 1000 });
|
||||
const third = new LogTask("Long Third", { delay: 2500 });
|
||||
const fourth = new FetchTask("Fetch Something", {
|
||||
url: "https://jsonplaceholder.typicode.com/todos/1"
|
||||
});
|
||||
const fifth = new LogTask("Task 4", { delay: 500 }); // without connection
|
||||
|
||||
const simpleFetch = new Flow("simpleFetch", [first, second, third, fourth, fifth]);
|
||||
simpleFetch.task(first).asInputFor(second);
|
||||
simpleFetch.task(first).asInputFor(third);
|
||||
simpleFetch.task(fourth).asOutputFor(third);
|
||||
|
||||
simpleFetch.setRespondingTask(fourth);
|
||||
|
||||
export { simpleFetch };
|
||||
Reference in New Issue
Block a user