You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The JSON API provides a collection of endpoints that can be queried for data.
In principle, the Cloe UI has two phases: setup and update. In the setup
phase, the context of the simulation is queried, the model dynamic UI is
created, and initial data values are shown. From this point on, the structure
remains the same and the server is queried for updates.
This can result in an excessive load, especially if the simulation is already
running in a speed that is less than realtime. A more efficient solution would
be that the UI does not need to poll for updates, but instead subscribe to
them.
Requirements
The following requirements have been collected through an informal process of
information gathering and brainstorming.
Information for the update phase can be subscribed to.
This is necessary to reduce the (possibly) excessive number of GET requests
that would otherwise be required to acquire all the information needed.
Proposal
The following design attempts to fulfill the requirements in a sustainable
way:
Web sockets is used to provide the network pattern of publishing and
subscribing.
This is already used to a small degree in the Cloe runtime, so expanding
its usage does not add an extra dependency.
Collections of endpoints can be subscribed to.
By allowing endpoints to subscribe to a collection of endpoints, the burden
is placed on the server to provide them. This extra effort is not more than
it would otherwise be.
An endpoint, such as /api/subscribe is provided which can receive a JSON
list of endpoints that should be returned in a subscription response:
Once the client has connected, it will receive updates as JSON objects,
where each endpoint is a key, and the response of that endpoint is the
value of the key::
Replacement of the current network server (libcppnetlib) is required for
WebSockets support.
How does a client signal that it is no longer interested in a subscription?
How do we efficiently support multiple Cloe UI instances? Is this even
necessary?
How does a client change the update interval after subscribing to
a collection of endpoints?
One approach here would be to close a subscription and restart with
a different update interval.
Logging Endpoint
It would be useful for Cloe logging output to be fetchable from a web endpoint.
It's likely not performant to store the logging data and return it all, so
streaming seems like the best fit.
The text was updated successfully, but these errors were encountered:
Publish-Subscribe JSON API
The JSON API provides a collection of endpoints that can be queried for data.
In principle, the Cloe UI has two phases: setup and update. In the setup
phase, the context of the simulation is queried, the model dynamic UI is
created, and initial data values are shown. From this point on, the structure
remains the same and the server is queried for updates.
This can result in an excessive load, especially if the simulation is already
running in a speed that is less than realtime. A more efficient solution would
be that the UI does not need to poll for updates, but instead subscribe to
them.
Requirements
The following requirements have been collected through an informal process of
information gathering and brainstorming.
Information for the update phase can be subscribed to.
This is necessary to reduce the (possibly) excessive number of GET requests
that would otherwise be required to acquire all the information needed.
Proposal
The following design attempts to fulfill the requirements in a sustainable
way:
Web sockets is used to provide the network pattern of publishing and
subscribing.
This is already used to a small degree in the Cloe runtime, so expanding
its usage does not add an extra dependency.
Collections of endpoints can be subscribed to.
By allowing endpoints to subscribe to a collection of endpoints, the burden
is placed on the server to provide them. This extra effort is not more than
it would otherwise be.
An endpoint, such as
/api/subscribe
is provided which can receive a JSONlist of endpoints that should be returned in a subscription response:
Only endpoints that have the API prefix can be subscribed to.
The server returns a ZeroMQ endpoint that the UI should use to connect to:
Once the client has connected, it will receive updates as JSON objects,
where each endpoint is a key, and the response of that endpoint is the
value of the key::
Challenges
Replacement of the current network server (libcppnetlib) is required for
WebSockets support.
How does a client signal that it is no longer interested in a subscription?
How do we efficiently support multiple Cloe UI instances? Is this even
necessary?
How does a client change the update interval after subscribing to
a collection of endpoints?
One approach here would be to close a subscription and restart with
a different update interval.
Logging Endpoint
It would be useful for Cloe logging output to be fetchable from a web endpoint.
It's likely not performant to store the logging data and return it all, so
streaming seems like the best fit.
The text was updated successfully, but these errors were encountered: