Skip to content
This repository has been archived by the owner on Feb 25, 2021. It is now read-only.

Commit

Permalink
Merge branch 'master' of https://github.com/bcoe/sandcastle
Browse files Browse the repository at this point in the history
  • Loading branch information
ndob committed Dec 18, 2013
2 parents 42c8694 + 4bf5aa7 commit 6c49b67
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,29 @@ Hey Ben Hello World!
* __on('exit'):__ this event is called when an untrusted script finishes execution.
* __run()__ starts the execution of an untrusted script.

Executing Scripts on Pool of SandCastles
----------------------
A pool consists of several SandCastle child-processes, which will handle the script execution. Pool-object is a drop-in replacement of single Sandcastle instance. Only difference is, when creating the Pool-instance.

You can specify the amount of child-processes with parameter named numberOfInstances (default = 1).
```javascript
var Pool = require('sandcastle').Pool;

var poolOfSandcastles = new Pool( { numberOfInstances: 3 } );

var script = poolOfSandcastles.createScript("\
exports.main = function() {\
exit('Hello World!');\
}\
");

script.on('exit', function(err, output) {
console.log(output);
});

script.run();
```

Handling Timeouts
-----------------------

Expand Down

0 comments on commit 6c49b67

Please sign in to comment.