Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Communication improvements #83

Open
h3ndrk opened this issue Jan 29, 2023 · 0 comments
Open

Communication improvements #83

h3ndrk opened this issue Jan 29, 2023 · 0 comments

Comments

@h3ndrk
Copy link
Member

h3ndrk commented Jan 29, 2023

  • Try to get rid of #[derive(Default)] for most of the types
  • Make StoreToDisk more intelligent or give client more control into which file and in which variant to store back. Currently, multiple stores may grow the head configuration file in the location without need because we cannot detect easily which items to discard.
  • Only send updates to subscribed clients if the values actually changed.
  • Document Communication design (refinement needed):
    • Messages
      • Requests are always textual, binary requests are protocol errors
      • At least within textual stream, messages are in order
      • Each sent data frame contains all textual data of this frame and binary references
        • This allows to have the binary stream separate and only the order in the textual stream matters
      • When the client subscribes, the request's id is used to store the subscription, unsubscribe in the future, and receive updated data from the server
      • Clients must specify with which cycler instance they want to speak
    • Databases
      • Clients choose subscription IDs, they need to be prefixed with a unique client identifier (e.g. peer address)
      • These asynchronous tasks exist: provider n--1 router 1--1 receiver/sender
        • Single router demultiplexes to provider
        • Each connected cycler instance spawns a provider task
      • Each provider task stores subscriptions
      • All provider tasks and the receiver tasks can send requests to the router
      • The provider first registers itself at the router
      • GetNext and Subscribe ids are shared and need to be unique
    • Parameters
      • framework configuration parsing (directory parsing based on hardware ids)
      • run(path), Runtime::start(path, amount_of_slots), Runtime::get_parameters_reader()
      • communication encapsulates multiple buffering creation
      • subscriptions, whole parameters: updating/writing/notifications/data state
      • path, target (default, location, body in default, head in default, body in location, head in location)
      • with SerializeHierarchy
      • if path.is_empty() { serde_json::to_value(parameters) } else { parameters.serialize_hierarchy() }
        • integrate this into SerializeHierarchy?
      • merge value into larger JSON object
      • diff + highest priority JSON
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant