Skip to content

Commit

Permalink
describe idleTimeout and broker option
Browse files Browse the repository at this point in the history
  • Loading branch information
paed01 committed Jul 16, 2023
1 parent 540f5c0 commit f9e9cf1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ app.use('/rest', bpmnEngineMiddleware());

app.use(errorHandler);

app.listen(3000);

function errorHandler(err, req, res, next) {
if (!(err instanceof Error)) return next();
if (err instanceof HttpError) return res.status(err.statusCode).send({ message: err.message });
Expand All @@ -27,9 +29,11 @@ function errorHandler(err, req, res, next) {

## Options

- `adapter`: Optional [storage adapter](#storage-adapter). Defaults to in-memory adapter
- `adapter`: Optional [storage adapter](#storage-adapter). Defaults to in-memory adapter based on LRU cache
- `engineOptions`: Optional BPMN Engine [options](https://github.com/paed01/bpmn-engine/blob/master/docs/API.md)
- `engineCache`: Optional engine LRU cache, defaults to `new LRUCache({ max: 1000 })`
- `broker`: Optional [smqp](https://npmjs.com/package/smqp) broker, used for forwarding events from executing engines
- `idleTimeout`: Optional positive integer, engine execution timeout in milliseconds before engine execution is considered idle and is stopped, defaults to 120000ms

# Routes

Expand Down
4 changes: 4 additions & 0 deletions example/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Example app
===========

Start your Camunda Modeler and hit play. REST endpoint is `http://localhost:3000/rest`.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{
"name": "bpmn-middleware",
"version": "0.0.2",
"version": "0.0.3",
"description": "BPMN engine express middleware",
"type": "module",
"main": "dist/main.cjs",
"module": "src/index.js",
"types": "index.d.ts",
"scripts": {
"test": "mocha -R dot",
"posttest": "npm run lint && npm run dist && npm run tsd",
Expand Down

0 comments on commit f9e9cf1

Please sign in to comment.