SlideShare uma empresa Scribd logo
1 de 49
Baixar para ler offline
Reactive Hypermedia APIs
Kevin Swiber
CODEMASH V2.0.1.5
I Like Buzzwords
Open source platform for
the Internet of Things
http://zettajs.org
APIs Suck
/data.cgi
/data.cgi
N00BIE
.NET Remoting
.NET Remoting
BROKEN
SOAP
SOAP
STUPID
RESTful?
RESTful?
WRONG
Hypermedia!
Hypermedia!NERD
What’s the problem?
The real world is complex
Feedback can be vicious
We fool ourselves into thinking
all problems are the same
There is no silver bullet
Love the bomb
The 15th Standard
Back to Zetta (IoT)
Reaching the Edge
DevicesDevicesDevices
Zetta
Zetta
DevicesDevicesDevices
Zetta
ClientsClientsClients
ClientsClientsClients Local Network
Data Center
Internet
The only thing we control
Desired Architectural
Properties
• Decoupling of implementations
• Independent evolution
• Scale
• Load balancing
• Centralize complexity, distribute simplicity
• Reduce latency
• Support event streams
Architectural Constraints
• Client-server, stateless, cacheable, layered
system, uniform interface, etc.
Wait, isn’t that REST?
The hypest of all media!
http://sirenspec.org
What about event streams?
How streams are done over
HTTP today
• WebHooks
• Chunked Transfer-Encoding
• HTTP Pipelining
• Long Polling
• Server Sent Events
X
X
X
X
X
Just upgrade
Connection info is in the
action parameters or link URI
• mqtt://example.org:8863/topic
• stomp+ws://example.org/topic
• amqp://example.org/topic
• { “href”: “ws://example.org”, “protocol”: “custom” }
It works!
Model resources as finite
state machines
LED.prototype.init = function(config) {
config
.type('led')
.state('off')
.when('off', { allow: ['turn-on'] })
.when('on', { allow: ['turn-off'] })
.map('turn-on', this.turnOn)
.map('turn-off', this.turnOff);
};
Transitions are represented as
affordances in the message.
"actions": [
{
"name": "turn-on",
"method": "POST",
"href": “...”,
"fields": [
{
"name": "action",
"type": "hidden",
"value": "turn-on"
}
]
}
]
We need to consume an
object stream.
links: [
{
title: “pulse“,
rel: [“http://rxapi.org/object-stream“],
href: “ws://...”
}
]
We need to consume an
object stream.
» wscat -c ws://...
connected (press CTRL+C to quit)
< {"topic":"heartbeat/1/pulse","timestamp":1411757412119,"data":61}
< {"topic":"heartbeat/1/pulse","timestamp":1411757412620,"data":65}
< {"topic":"heartbeat/1/pulse","timestamp":1411757413121,"data":69}
< {"topic":"heartbeat/1/pulse","timestamp":1411757413622,"data":71}
< {"topic":"heartbeat/1/pulse","timestamp":1411757414124,"data":66}
< {"topic":"heartbeat/1/pulse","timestamp":1411757414626,"data":64}
< {"topic":"heartbeat/1/pulse","timestamp":1411757415128,"data":68}
< {"topic":"heartbeat/1/pulse","timestamp":1411757415629,"data":63}
< {"topic":"heartbeat/1/pulse","timestamp":1411757416130,"data":65}
< {"topic":"heartbeat/1/pulse","timestamp":1411757416631,"data":63}
Monitor resource events
before taking action.
links: [
{
title: “logs“,
rel: [
“monitor“,
“http://rxapi.org/object-stream“
],
href: “ws://...”
}
]
Monitor resource events
before taking action.
» wscat -c ws://...
connected (press CTRL+C to quit)
< {"topic":"led/2/logs","timestamp":
1411809676901,"transition":"turn-on","input":[],"properties":
{"id":"2","type":"led","name":null,"state":"on"}}
< {"topic":"led/2/logs","timestamp":
1411809677548,"transition":"turn-off","input":[],"properties":
{"id":"2","type":"led","name":null,"state":"off"}}
< {"topic":"led/2/logs","timestamp":
1411809678483,"transition":"turn-on","input":[],"properties":
{"id":"2","type":"led","name":null,"state":"on"}}
< {"topic":"led/2/logs","timestamp":
1411809679126,"transition":"turn-off","input":[],"properties":
{"id":"2","type":"led","name":null,"state":"off"}}
We also need binary.
links: [
{
rel: [“http://rxapi.org/binary-stream“],
href: “ws://...“,
type: “video/mpeg“,
}
]
We also need binary.
» wscat -c ws://...
connected (press CTRL+C to quit)
Q`rCEDˌDIp=`"3ss79:Yk}{` 5e`>9%J[K89z^> 8X Gp;W̮qXF
h1{%O;7<Bi‫.ڞ‬r r5
vyeK[X@ƯDRmT:uLz[‫ޱްޯޮޭެޫުީިާަޥޤޣޢޡޠޟޞޝޜޛޚޙޘޗޖޕޔޓޒޑސޏގލތދފމވއކޅބރނށހ‬V
.vK",,u!N8֝=LQ=s~ӆ`]{E6[
WȝM]3Uo|&n
Њmo('/K>2칩e,l{%`:<rtN|SXu曆psFJS*s#AB]ý0Rt_`uS}vX3ctA>kJfuΎ^L๖䜼V"u8GU
‫*ڹ‬
We also need binary.
» wscat -c ws://...
connected (press CTRL+C to quit)
Reactive Clients
var siren = require('siren');
!
siren()
.load('http://zetta-cloud-2.herokuapp.com')
.link('http://rels.zettajs.io/peer', 'Detroit')
.entity(function(e) {
return e.properties.type === 'sound';
})
.link('http://rels.zettajs.io/object-stream', 'level')
.monitor()
.subscribe(console.log);
Reactive Clients
var zrx = require('zrx');
!
zrx()
.load('http://zetta-cloud-2.herokuapp.com')
.server('Detroit')
.device(function(d) {
return d.type === 'sound';
})
.stream('level')
.subscribe(console.log);
Going Forward
Solve the producer-
consumer problem.
Reactive Stream Control
Protocol
• Consumer controlled streams
• Runs over WebSockets
• Multiplex streams
• URI scheme definition
• Will be supported on HTTP/2 + WebSockets.
What can you do with
streams?
• Monitoring values over time
• Distributed data processing
• Event sourcing
• Batches
// TODO:
• Extract reactive hypermedia framework from
Zetta internals.
• Produce a clean specification and
documentation.
• Experiment with multiple languages/platform
implementations.
Hit me up!
• kswiber@gmail.com
• https://twitter.com/kevinswiber
• https://linkedin.com/in/kevinswiber
• https://github.com/kevinswiber

Mais conteúdo relacionado

Mais procurados

Lessons Learned - Monitoring the Data Pipeline at Hulu
Lessons Learned - Monitoring the Data Pipeline at HuluLessons Learned - Monitoring the Data Pipeline at Hulu
Lessons Learned - Monitoring the Data Pipeline at Hulu
DataWorks Summit
 
NoSQL Data Stores in Research and Practice - ICDE 2016 Tutorial - Extended Ve...
NoSQL Data Stores in Research and Practice - ICDE 2016 Tutorial - Extended Ve...NoSQL Data Stores in Research and Practice - ICDE 2016 Tutorial - Extended Ve...
NoSQL Data Stores in Research and Practice - ICDE 2016 Tutorial - Extended Ve...
Felix Gessert
 

Mais procurados (20)

best aws training in bangalore
best aws training in bangalorebest aws training in bangalore
best aws training in bangalore
 
Cassandra SF 2015 - Repeatable, Scalable, Reliable, Observable Cassandra
Cassandra SF 2015 - Repeatable, Scalable, Reliable, Observable CassandraCassandra SF 2015 - Repeatable, Scalable, Reliable, Observable Cassandra
Cassandra SF 2015 - Repeatable, Scalable, Reliable, Observable Cassandra
 
Web Performance – die effektivsten Techniken aus der Praxis
Web Performance – die effektivsten Techniken aus der PraxisWeb Performance – die effektivsten Techniken aus der Praxis
Web Performance – die effektivsten Techniken aus der Praxis
 
Real-time personal trainer on the SMACK stack
Real-time personal trainer on the SMACK stackReal-time personal trainer on the SMACK stack
Real-time personal trainer on the SMACK stack
 
Building a system for machine and event-oriented data - Data Day Seattle 2015
Building a system for machine and event-oriented data - Data Day Seattle 2015Building a system for machine and event-oriented data - Data Day Seattle 2015
Building a system for machine and event-oriented data - Data Day Seattle 2015
 
from source to solution - building a system for event-oriented data
from source to solution - building a system for event-oriented datafrom source to solution - building a system for event-oriented data
from source to solution - building a system for event-oriented data
 
Building a system for machine and event-oriented data - Velocity, Santa Clara...
Building a system for machine and event-oriented data - Velocity, Santa Clara...Building a system for machine and event-oriented data - Velocity, Santa Clara...
Building a system for machine and event-oriented data - Velocity, Santa Clara...
 
Elasticsearch 5.0
Elasticsearch 5.0Elasticsearch 5.0
Elasticsearch 5.0
 
Lessons Learned - Monitoring the Data Pipeline at Hulu
Lessons Learned - Monitoring the Data Pipeline at HuluLessons Learned - Monitoring the Data Pipeline at Hulu
Lessons Learned - Monitoring the Data Pipeline at Hulu
 
Going native with Apache Cassandra
Going native with Apache CassandraGoing native with Apache Cassandra
Going native with Apache Cassandra
 
Deep Dive Into Elasticsearch
Deep Dive Into ElasticsearchDeep Dive Into Elasticsearch
Deep Dive Into Elasticsearch
 
Cassandra 2.0 (Introduction)
Cassandra 2.0 (Introduction)Cassandra 2.0 (Introduction)
Cassandra 2.0 (Introduction)
 
Woa. Reloaded
Woa. ReloadedWoa. Reloaded
Woa. Reloaded
 
Cassandra 2.0 to 2.1
Cassandra 2.0 to 2.1Cassandra 2.0 to 2.1
Cassandra 2.0 to 2.1
 
Reactive Streams 1.0.0 and Why You Should Care (webinar)
Reactive Streams 1.0.0 and Why You Should Care (webinar)Reactive Streams 1.0.0 and Why You Should Care (webinar)
Reactive Streams 1.0.0 and Why You Should Care (webinar)
 
quick intro to elastic search
quick intro to elastic search quick intro to elastic search
quick intro to elastic search
 
NoSQL Data Stores in Research and Practice - ICDE 2016 Tutorial - Extended Ve...
NoSQL Data Stores in Research and Practice - ICDE 2016 Tutorial - Extended Ve...NoSQL Data Stores in Research and Practice - ICDE 2016 Tutorial - Extended Ve...
NoSQL Data Stores in Research and Practice - ICDE 2016 Tutorial - Extended Ve...
 
Webinar: Getting Started with Apache Cassandra
Webinar: Getting Started with Apache CassandraWebinar: Getting Started with Apache Cassandra
Webinar: Getting Started with Apache Cassandra
 
Sherlock Homepage - A detective story about running large web services (VISUG...
Sherlock Homepage - A detective story about running large web services (VISUG...Sherlock Homepage - A detective story about running large web services (VISUG...
Sherlock Homepage - A detective story about running large web services (VISUG...
 
azure synapse analytics end-to-end solution-hands-on at 20200728
azure synapse analytics end-to-end solution-hands-on at 20200728azure synapse analytics end-to-end solution-hands-on at 20200728
azure synapse analytics end-to-end solution-hands-on at 20200728
 

Semelhante a Reactive Hypermedia APIs

Standard Provenance Reporting and Scientific Software Management in Virtual L...
Standard Provenance Reporting and Scientific Software Management in Virtual L...Standard Provenance Reporting and Scientific Software Management in Virtual L...
Standard Provenance Reporting and Scientific Software Management in Virtual L...
njcar
 

Semelhante a Reactive Hypermedia APIs (20)

Designing an API for the Internet of Things
Designing an API for the Internet of ThingsDesigning an API for the Internet of Things
Designing an API for the Internet of Things
 
Why OpenStack on UCS? An Introduction to Red Hat and Cisco OpenStack Solution
Why OpenStack on UCS? An Introduction to Red Hat and Cisco OpenStack SolutionWhy OpenStack on UCS? An Introduction to Red Hat and Cisco OpenStack Solution
Why OpenStack on UCS? An Introduction to Red Hat and Cisco OpenStack Solution
 
Integrate Solr with real-time stream processing applications
Integrate Solr with real-time stream processing applicationsIntegrate Solr with real-time stream processing applications
Integrate Solr with real-time stream processing applications
 
Original slides from Ryan Dahl's NodeJs intro talk
Original slides from Ryan Dahl's NodeJs intro talkOriginal slides from Ryan Dahl's NodeJs intro talk
Original slides from Ryan Dahl's NodeJs intro talk
 
Springone2gx 2014 Reactive Streams and Reactor
Springone2gx 2014 Reactive Streams and ReactorSpringone2gx 2014 Reactive Streams and Reactor
Springone2gx 2014 Reactive Streams and Reactor
 
FlinkForward Asia 2019 - Evolving Keystone to an Open Collaborative Real Time...
FlinkForward Asia 2019 - Evolving Keystone to an Open Collaborative Real Time...FlinkForward Asia 2019 - Evolving Keystone to an Open Collaborative Real Time...
FlinkForward Asia 2019 - Evolving Keystone to an Open Collaborative Real Time...
 
Building a system for machine and event-oriented data with Rocana
Building a system for machine and event-oriented data with RocanaBuilding a system for machine and event-oriented data with Rocana
Building a system for machine and event-oriented data with Rocana
 
Web_of_Things_2013
Web_of_Things_2013Web_of_Things_2013
Web_of_Things_2013
 
Building a system for machine and event-oriented data - SF HUG Nov 2015
Building a system for machine and event-oriented data - SF HUG Nov 2015Building a system for machine and event-oriented data - SF HUG Nov 2015
Building a system for machine and event-oriented data - SF HUG Nov 2015
 
Building production websites with Node.js on the Microsoft stack
Building production websites with Node.js on the Microsoft stackBuilding production websites with Node.js on the Microsoft stack
Building production websites with Node.js on the Microsoft stack
 
Event-driven IO server-side JavaScript environment based on V8 Engine
Event-driven IO server-side JavaScript environment based on V8 EngineEvent-driven IO server-side JavaScript environment based on V8 Engine
Event-driven IO server-side JavaScript environment based on V8 Engine
 
C* Summit 2013: Real-time Analytics using Cassandra, Spark and Shark by Evan ...
C* Summit 2013: Real-time Analytics using Cassandra, Spark and Shark by Evan ...C* Summit 2013: Real-time Analytics using Cassandra, Spark and Shark by Evan ...
C* Summit 2013: Real-time Analytics using Cassandra, Spark and Shark by Evan ...
 
VoltDB on SolftLayer Cloud
VoltDB on SolftLayer CloudVoltDB on SolftLayer Cloud
VoltDB on SolftLayer Cloud
 
Data encoding and Metadata for Streams
Data encoding and Metadata for StreamsData encoding and Metadata for Streams
Data encoding and Metadata for Streams
 
Web of Things - Connecting People and Objects on the Web
Web of Things - Connecting People and Objects on the WebWeb of Things - Connecting People and Objects on the Web
Web of Things - Connecting People and Objects on the Web
 
Standard Provenance Reporting and Scientific Software Management in Virtual L...
Standard Provenance Reporting and Scientific Software Management in Virtual L...Standard Provenance Reporting and Scientific Software Management in Virtual L...
Standard Provenance Reporting and Scientific Software Management in Virtual L...
 
OpenWhisk: Where Did My Servers Go?
OpenWhisk: Where Did My Servers Go?OpenWhisk: Where Did My Servers Go?
OpenWhisk: Where Did My Servers Go?
 
Reactor, Reactive streams and MicroServices
Reactor, Reactive streams and MicroServicesReactor, Reactive streams and MicroServices
Reactor, Reactive streams and MicroServices
 
Introduction to Apache CloudStack by David Nalley
Introduction to Apache CloudStack by David NalleyIntroduction to Apache CloudStack by David Nalley
Introduction to Apache CloudStack by David Nalley
 
introduction to node.js
introduction to node.jsintroduction to node.js
introduction to node.js
 

Último

Último (20)

A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 

Reactive Hypermedia APIs

  • 1. Reactive Hypermedia APIs Kevin Swiber CODEMASH V2.0.1.5
  • 3. Open source platform for the Internet of Things http://zettajs.org
  • 16. The real world is complex
  • 17. Feedback can be vicious
  • 18. We fool ourselves into thinking all problems are the same
  • 19.
  • 20. There is no silver bullet
  • 23. Back to Zetta (IoT)
  • 25. Desired Architectural Properties • Decoupling of implementations • Independent evolution • Scale • Load balancing • Centralize complexity, distribute simplicity • Reduce latency • Support event streams
  • 26. Architectural Constraints • Client-server, stateless, cacheable, layered system, uniform interface, etc. Wait, isn’t that REST?
  • 27. The hypest of all media! http://sirenspec.org
  • 28. What about event streams?
  • 29. How streams are done over HTTP today • WebHooks • Chunked Transfer-Encoding • HTTP Pipelining • Long Polling • Server Sent Events X X X X X
  • 31. Connection info is in the action parameters or link URI • mqtt://example.org:8863/topic • stomp+ws://example.org/topic • amqp://example.org/topic • { “href”: “ws://example.org”, “protocol”: “custom” }
  • 33. Model resources as finite state machines LED.prototype.init = function(config) { config .type('led') .state('off') .when('off', { allow: ['turn-on'] }) .when('on', { allow: ['turn-off'] }) .map('turn-on', this.turnOn) .map('turn-off', this.turnOff); };
  • 34. Transitions are represented as affordances in the message. "actions": [ { "name": "turn-on", "method": "POST", "href": “...”, "fields": [ { "name": "action", "type": "hidden", "value": "turn-on" } ] } ]
  • 35. We need to consume an object stream. links: [ { title: “pulse“, rel: [“http://rxapi.org/object-stream“], href: “ws://...” } ]
  • 36. We need to consume an object stream. » wscat -c ws://... connected (press CTRL+C to quit) < {"topic":"heartbeat/1/pulse","timestamp":1411757412119,"data":61} < {"topic":"heartbeat/1/pulse","timestamp":1411757412620,"data":65} < {"topic":"heartbeat/1/pulse","timestamp":1411757413121,"data":69} < {"topic":"heartbeat/1/pulse","timestamp":1411757413622,"data":71} < {"topic":"heartbeat/1/pulse","timestamp":1411757414124,"data":66} < {"topic":"heartbeat/1/pulse","timestamp":1411757414626,"data":64} < {"topic":"heartbeat/1/pulse","timestamp":1411757415128,"data":68} < {"topic":"heartbeat/1/pulse","timestamp":1411757415629,"data":63} < {"topic":"heartbeat/1/pulse","timestamp":1411757416130,"data":65} < {"topic":"heartbeat/1/pulse","timestamp":1411757416631,"data":63}
  • 37. Monitor resource events before taking action. links: [ { title: “logs“, rel: [ “monitor“, “http://rxapi.org/object-stream“ ], href: “ws://...” } ]
  • 38. Monitor resource events before taking action. » wscat -c ws://... connected (press CTRL+C to quit) < {"topic":"led/2/logs","timestamp": 1411809676901,"transition":"turn-on","input":[],"properties": {"id":"2","type":"led","name":null,"state":"on"}} < {"topic":"led/2/logs","timestamp": 1411809677548,"transition":"turn-off","input":[],"properties": {"id":"2","type":"led","name":null,"state":"off"}} < {"topic":"led/2/logs","timestamp": 1411809678483,"transition":"turn-on","input":[],"properties": {"id":"2","type":"led","name":null,"state":"on"}} < {"topic":"led/2/logs","timestamp": 1411809679126,"transition":"turn-off","input":[],"properties": {"id":"2","type":"led","name":null,"state":"off"}}
  • 39. We also need binary. links: [ { rel: [“http://rxapi.org/binary-stream“], href: “ws://...“, type: “video/mpeg“, } ]
  • 40. We also need binary. » wscat -c ws://... connected (press CTRL+C to quit) Q`rCEDˌDIp=`"3ss79:Yk}{` 5e`>9%J[K89z^> 8X Gp;W̮qXF h1{%O;7<Bi‫.ڞ‬r r5 vyeK[X@ƯDRmT:uLz[‫ޱްޯޮޭެޫުީިާަޥޤޣޢޡޠޟޞޝޜޛޚޙޘޗޖޕޔޓޒޑސޏގލތދފމވއކޅބރނށހ‬V .vK",,u!N8֝=LQ=s~ӆ`]{E6[ WȝM]3Uo|&n Њmo('/K>2칩e,l{%`:<rtN|SXu曆psFJS*s#AB]ý0Rt_`uS}vX3ctA>kJfuΎ^L๖䜼V"u8GU ‫*ڹ‬
  • 41. We also need binary. » wscat -c ws://... connected (press CTRL+C to quit)
  • 42. Reactive Clients var siren = require('siren'); ! siren() .load('http://zetta-cloud-2.herokuapp.com') .link('http://rels.zettajs.io/peer', 'Detroit') .entity(function(e) { return e.properties.type === 'sound'; }) .link('http://rels.zettajs.io/object-stream', 'level') .monitor() .subscribe(console.log);
  • 43. Reactive Clients var zrx = require('zrx'); ! zrx() .load('http://zetta-cloud-2.herokuapp.com') .server('Detroit') .device(function(d) { return d.type === 'sound'; }) .stream('level') .subscribe(console.log);
  • 46. Reactive Stream Control Protocol • Consumer controlled streams • Runs over WebSockets • Multiplex streams • URI scheme definition • Will be supported on HTTP/2 + WebSockets.
  • 47. What can you do with streams? • Monitoring values over time • Distributed data processing • Event sourcing • Batches
  • 48. // TODO: • Extract reactive hypermedia framework from Zetta internals. • Produce a clean specification and documentation. • Experiment with multiple languages/platform implementations.
  • 49. Hit me up! • kswiber@gmail.com • https://twitter.com/kevinswiber • https://linkedin.com/in/kevinswiber • https://github.com/kevinswiber