Ken Perkins | Rackspace | @kenperkinsPhani Raj | HP Cloud | @phanirajuyn
Platform built on Chrome's V8 JavaScript runtime.
...uses an event-driven, non-blocking I/O model that makes it lightweight and efficient...Asynchronous workloads, coordination,integrating multiple systems, provisioning.
CPU intensive workloads, Maths, non-intuitive patterns
var http = require('http'); var handler = function (req, res) { res.writeHead(200, {'Content-Type': 'text/plain'}); res.end('Hello World\n'); } var server = http.createServer(handler); server.listen(1337, '127.0.0.1'); console.log('Server running at http://127.0.0.1:1337/');
var handler = function(req, res) { req.records.forEach(function(record) { // iterating this array will block until done }); res.writeHead(200, {'Content-Type': 'text/plain'}); res.end('Success!\n'); };
var async = require('async'); var handler = function(req, res) { async.each(req.records, function(record, next) { // when you're done with your processing, invoke next to continue next(); }, function() { res.writeHead(200, {'Content-Type': 'text/plain'}); res.end('Success!\n'); }); };
Created by nodejitsu December 2011initially compute & storage on Rackspace.
Vision: support for multiple providers and a generalized interface.
Committing to an existing multi-cloud library was better.
Examples: Apache jclouds, fog, and Apache Libcloud.
Originally offered hpcloud-js.
hpcloud-js is now deprecated in favor of pkgcloud
pkgcloud endorsed on developer.openstack.org as the node.js SDK for openstack
var pkgcloud = require('pkgcloud'); var client = pkgcloud.compute.createClient({ provider: 'openstack', username: 'my-user-name', password: 'my-password', authUrl: 'http://my-auth-endpoint' });
var pkgcloud = require('pkgcloud'); var client = pkgcloud.providers.openstack.compute.createClient({ username: 'my-user-name', password: 'my-password', authUrl: 'http://my-auth-endpoint' });
Demo
Demo
Demo
Where does pkgcloud go from here?
Or we need your help...
#pkgcloud on Freenode IRC, github.com/pkgcloud/pkgcloud on Github