Here's a brief analysis of RPC vs. REST based on one person's opinion.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "type": "api", | |
| "identifier": "zetta", | |
| "description": "The Zetta IoT API", | |
| "descriptors": [ | |
| { | |
| "type": "class", | |
| "identifier": "root", | |
| "description": "The root resource of a Zetta API.", | |
| "descriptors": [ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var MetadataResource = require('./metadata_resource'); | |
| module.exports = function(server) { | |
| var argo = server.httpServer.cloud; | |
| argo.add(MetadataResource, server); | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var Rx = require('rx'); | |
| var zrx = require('zrx'); | |
| var siren = require('siren'); | |
| var MAX = 10; | |
| var CLOUD = 'http://testing.iot.apigee.net'; | |
| var count = 0; | |
| var started = false; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var Rx = require('rx'); | |
| var zrx = require('./zrx'); | |
| var subject = new Rx.ReplaySubject(); | |
| var detroit = zrx() | |
| .load('http://zetta-cloud-2.herokuapp.com') | |
| .server('Detroit') | |
| .subscribe(subject); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var zrx = require('zrx'); | |
| zrx() | |
| .load('http://zetta-cloud-2.herokuapp.com') | |
| .servers() | |
| .devices() | |
| .toDevice() | |
| .subscribe(console.log) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var fs = require('fs'); | |
| var request = require('request'); | |
| var url = 'https://github.com/joyent/node/archive/v0.10.36.tar.gz'; | |
| request(url) | |
| .on('error', function(err) { | |
| console.error('error:', err); | |
| }) | |
| .on('response', function(response) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #![allow(unstable)] | |
| #![feature(unboxed_closures)] | |
| fn main() { | |
| let action = Action { f: || { println!("action"); } }; | |
| action.call(); | |
| let a1 = Action1 { f: |n| { println!("action1: {:?}", n); } }; | |
| a1.call(42i32); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "id": "node-hello-world", | |
| "container": { | |
| "type": "DOCKER", | |
| "docker": { | |
| "image": "kevinswiber/docker-ubuntu-nodejs-hello", | |
| "network": "BRIDGE", | |
| "portMappings": [ | |
| { | |
| "containerPort": 3000, |