Skip to content

Commit 6beadc1

Browse files
committed
added destroy example
1 parent 0d50eb7 commit 6beadc1

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

README.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ var StatefulProcessCommandProxy = require("./");
9393
var statefulProcessCommandProxy = new StatefulProcessCommandProxy(
9494
{
9595
name: "test",
96-
max: 1,
97-
min: 1,
96+
max: 2,
97+
min: 2,
9898
idleTimeoutMillis: 10000,
9999
100100
logFunction: function(severity,origin,msg) {
@@ -139,6 +139,15 @@ statefulProcessCommandProxy.executeCommand('echo testInitVar')
139139
}).catch(function(error) {
140140
console.log("Error: " + error);
141141
});
142+
143+
144+
statefulProcessCommandProxy.executeCommand('echo "this command has an error and will be '+
145+
' destroyed because it matches our invalidation regex"')
146+
.then(function(cmdResult) {
147+
console.log("testInitVar value: Stdout: " + cmdResult.stdout);
148+
}).catch(function(error) {
149+
console.log("Error: " + error);
150+
});
142151
143152
// set a var in the shell
144153
statefulProcessCommandProxy.executeCommand('MY_VARIABLE=test1;echo MY_VARIABLE WAS JUST SET')
@@ -160,7 +169,7 @@ setTimeout(function() {
160169
statefulProcessCommandProxy.shutdown();
161170
},5000);
162171
163-
```
172+
```
164173

165174
###<a id="security"></a> Security
166175

0 commit comments

Comments
 (0)