Elektrine lite

← Feed

@pid_eins@mastodon.social

Post #1496862

2026-03-02 09:41 UTC

@arianvp nah, it's nice if the varlink connection after the http/websocket parts survives multiple calls, for Accept=yes varlink services.

Replies (1)

  • @arianvp@functional.cafe 2026-03-02 11:47

    @pid_eins the `more` support and keeping connections open can easily be implemented with just native HTTP without having to switch to websockets. Doesn't even have to be SSE. Can just be a response that streams its results and splits the stream by NUL byte. The varlink semantics of queuing multiple requests and the need for responses to come back into the same order as requests makes it behave basically the same semantics as HTTP 1.1 Map each HTTP path to a varlink method call. And map the parameters to the request body Then simply stream back the reponse of the varlink call back over the http connection. If the varlink response streams multiple answers, just keep the http connection open Here is an example that reuses the same varlink connection over multiple HTTP calls; works fine! I really don't see the need for websockets here Here's a demo in a few lines of go: https://gist.github.com/arianvp/314113d4309c7d7d3047535e167352ac

    Open ##1496863