Push Additional Peer Data after Peer Connection
Opened this issue · 0 comments
Feature Request
When hitting the root "cloud" instance, each server object in the returned links
collection includes that server instance's custom properties
.
{
"title": "server-id",
"rel": [
"http://rels.zettajs.io/server"
],
"href": "http://localhost:1337/servers/server-id",
"properties": {
"name": "server-id",
"displayName": "detroit1"
}
},
{
"title": "peer-id",
"rel": [
"http://rels.zettajs.io/peer",
"http://rels.zettajs.io/server"
],
"href": "http://localhost:1337/servers/peer-id",
"properties": {
"name": "peer-id",
"displayName": "detroit2"
}
}
So Far
I've updated _renderRoot
in lib/api_resources/root.js to include properties
, which covers the root server "rel" entry.
env.response.body = {
class: ['root'],
links: [
{
rel: [rels.self],
href: env.helpers.url.current()
},
{
title: this.server._name,
rel: [rels.server],
href: env.helpers.url.path('/servers/' + encodeURI(this.server.id) ),
properties: this.server.getProperties()
},
What's Next
The data saved for each peer'd server in the registry does not include its properties
. I have not been able to figure out how to push that data from the connected zetta client to the zetta "cloud" instance after a peer connection is established.
I imagined an event like "_peer/properties" sent over the connection once it's established, and again after any call to Zetta.prototype.properties
. But nothing I've tried has worked.
Can you guys point me towards a possible solution?