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

Varlink API #5

Open
pzmarzly opened this issue Jun 4, 2024 · 0 comments
Open

Varlink API #5

pzmarzly opened this issue Jun 4, 2024 · 0 comments

Comments

@pzmarzly
Copy link

pzmarzly commented Jun 4, 2024

ht's API is an RPC-style newline-delimited JSON sent over stdin/stdout. This reminds me strongly of varlink, an IPC standard used by systemd and podman (the docker alternative). The biggest difference is that varlink uses null-byte-delimited JSON rather than newline-delimited JSON, and usually uses Unix sockets instead of stdin/stdout (so that many clients can connect at once).

What could be gained?

  • Instead of maintaining a list of supported methods in project README, with "this method returns XYZ" / "this method doesn't return", you could maintain a varlink IDL file
  • Streaming support, so that clients don't have to poll getView
  • Error messages by setting the error field in reply JSON
  • varlink CLI and systemd-varlinkctl CLI may make scripting and debugging easier
  • Autogenerated correct clients in many languages
  • Introspection - every varlink server has to reply to GetInfo and GetInterfaceDescription messages. This makes it easy for clients to see if a server version is new enough to support some new methods.

Note

This is an opinionated suggestion, feel free to disregard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant