Skip to content
Browse files

[examples] Added basic pummel spawn example

  • Loading branch information...
1 parent 0c10c98 commit d98e98984db209c06297b26801e214984727c3b1 @Marak Marak committed Apr 11, 2012
Showing with 46 additions and 0 deletions.
  1. +46 −0 examples/pummel-spawn.js
View
46 examples/pummel-spawn.js
@@ -0,0 +1,46 @@
+var eyes = require('eyes'),
+ haibu = require('../lib/haibu');
+
+// Create a new client for communicating with the haibu server
+var client = new haibu.drone.Client({
+ host: process.env.HOST || '127.0.0.1',
+ port: 9002
+});
+
+// A basic package.json for a node.js application on Haibu
+var app = {
+ "user": "marak",
+ "name": "test",
+ "domain": "devjitsu.com",
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/Marak/hellonode.git"
+ },
+ "scripts": {
+ "start": "server.js"
+ },
+ "engine": {
+ "node": "0.6.6"
+ }
+};
+
+var total = 200;
+
+function start() {
+
+ // Attempt to start up a new application
+ client.start(app, function (err, result) {
+ if (err) {
+ console.log('Error spawning app: ' + app.name);
+ return eyes.inspect(err);
+ }
+ if(total > 0) {
+ total--;
+ start();
+ }
+ //console.log('Successfully spawned app:');
+ //eyes.inspect(result);
+ });
+}
+
+start();

0 comments on commit d98e989

Please sign in to comment.
Something went wrong with that request. Please try again.