Skip to content

Commit cc73263

Browse files
authored
Update README.md
1 parent ad71f2c commit cc73263

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

examples/RemoteJobs/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ The distributed execution architecture consists of:
1111
- **Application software** - software that actually performs workflow tasks
1212

1313
In this example:
14-
- The workflow invokes function `submitRemoteJob` (Job invoker) from `functions.js` 100 times. This function simulates submission of jobs by starting 100 parallel processes of `node handler.js <taskId> <redis_url>`.
15-
- `../../../hyperflow-job-executor/handler.js` represents a remote job executor which is passed two parameters: `taskId` and `redis_url`.
16-
- `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.
17-
- On the HyperFlow engine side, the Job invoker can use two functions (provided by Hyperflow): `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.
14+
- The workflow has two tasks (see `workflow.json`): one that executes `job.js`, the other which simply runs `ls -l`. Note that the commands to be executed are specified in `workflow.json`.
15+
- The engine invokes the function `submitRemoteJob` (Job invoker) from `functions.js`. This function simulates submission of jobs by starting the Hyperflow job executor and communicating with it via Redis to run jobs.
16+
- `../../../hyperflow-job-executor/handler.js` represents a remote job executor which is passed two parameters: `taskId` and `redis_url`. The executor gets a `jobMessage` from HyperFlow, executes the command in a separate process, and then sends back a notification that the job has completed; `taskId` is used to construct appropriate Redis keys for this communication.
17+
- On the HyperFlow engine side, the Job invoker can use two functions (provided by Hyperflow): `context.sendMsgToJob` to send a message to the job executor, and `context.jobResult` to wait for the notification from the executor. These functions return a [`Promise`](https://javascript.info/promise-basics), so the async/await syntax can be used as shown in the example.
1818
- 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.
1919
- The Job invoker also gets the Redis URL in `context.redis_url` which can be passed to the remote job executors.
2020

0 commit comments

Comments
 (0)