Adapter/addon for Rexster having pubsub-like realtime notifications
Not for production, use at your own risk.
-
start the rexster server
./rexster.sh --start
-
start the rexster realtime adapter
coffee ./app.coffee
-
include the client API
<script src="/localhost:8000/client.js"></script>
-
write some javascript code
<script> var graph = packageme.require("rexster-client").getGraph("neo4jsample"); graph.addVertex({"my own property": "with json suitable value"}, function(err, createdVertex){ console.log(createdVertex); }); graph.addEdge(vertex._id, 42, "label", {createdAt: new Date()}, function(err, createdEdge){ console.log(createdEdge); }); ... graph.signals.newVertex(function(newVertex){ console.log(newVertex); }); ... </script>
newVertex
, signalData:Vertex
newEdge
, signalData:Edge
vertexRemoved
, signalData:{ _id }
edgeRemoved
, signalData:{ _id }
graphCleared
, signalData:{ }
vertexPropertyChanged
, signalData:{ _id, property1: value1, ... }
vertexPropertyRemoved
, signalData:{ _id }
edgePropertyChanged
, signalData:{ _id, property1: value1, ... }
edgePropertyRemoved
, signalData:{ _id, keys: ["property1", "property2"] }
Extends Node
Extends Node
rexster-realtime-adapter acts like realtime broker between rexster and any connected clients. When client initiates operation based on the above api, it gets send via http to rexster and subscribers listening for such event will be notified with the response of rexster.
Any http messages send directly to Rexster, won't fire notification to rexster-realtimer-adapter because the current REST API does not include such support (yet).
- launch app.coffee and open http://localhost:8000/tests/manual/index.html , look at the console.
- experiment