Skip to content

Commit 5414172

Browse files
authored
Update README.md
1 parent 9a0c6be commit 5414172

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

examples/TaskStatusRedis/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ This example demonstrates how HyperFlow can communicate with remote job executor
33

44
- The workflow invokes function `job_status_redis_test` from `functions.js` 100 times. This function simulates submission of jobs by starting 100 parallel processes of `handler.js`.
55
- `handler.js` represents a remote job executor which is passed two parameters: `taskId` and `redis_url`.
6-
- `handler.js` gets `jobMessage` from Redis, and then sends back a notification that the job has completed; `taskId` is used to construct appropriate Redis keys.
7-
- On the HyperFlow engine side, the Process Function can use two functions: `context.sendMsgToJob` to send a message to the job, and `context.taskStatus` to wait for the notification. These functions return a [`Promise`](https://javascript.info/promise-basics), so the async/await syntax can be used as shown in the example.
8-
- The parameter to the `context.taskStatus` function is a timeout in seconds (0 denotes infinity). One can use a retry library, such as [promise-retry](https://www.npmjs.com/package/promise-retry), to implement an exponential retry strategy.
6+
- `handler.js` gets a `jobMessage` from HyperFlow, and then sends back a notification that the job has completed; `taskId` is used to construct appropriate Redis keys for this communication.
7+
- On the HyperFlow engine side, the Process Function can use two functions: `context.sendMsgToJob` to send a message to the job, and `context.jobResult` to wait for the notification. These functions return a [`Promise`](https://javascript.info/promise-basics), so the async/await syntax can be used as shown in the example.
8+
- The parameter to the `context.jobResult` function is a timeout in seconds (0 denotes infinity). One can use a retry library, such as [promise-retry](https://www.npmjs.com/package/promise-retry), to implement an exponential retry strategy.
99
- The Process Function also gets the Redis URL in `context.redis_url` which can be passed to the remote job executors.
1010

1111
To run the workflow, simply do `hflow run .` in this directory. You might need to run once `npm install` to install dependencies.

0 commit comments

Comments
 (0)