-
Notifications
You must be signed in to change notification settings - Fork 69
[RFC] Expose public Event Stream varlink interface #358
Comments
cc @Profpatsch |
My suggestion would be to move the current stuff into
👍
This seems worth a re-think. Adding a public Varlink interface is a pretty big deal in itself and opens up tooling opportunities via language bindings as well as from Bash through the command line tool. As such, I would
|
A private A consequence is that Regardless, this change merits a minor version release. |
The tooling opportunities were exactly what made this approach appeal to me. As an integrator, I always appreciate options.
Perhaps? The I'd propose, as a first step, to make this interface change, and update the still |
Sounds good to me. Thanks for addressing my comments! |
What does exposing the interface give us that a plain stream of json values doesn’t? i.e. do you have use-cases in mind that the I’m very skeptical about making varlink part of our external interface, because universal is anything but. |
@curiousleo makes the point that Varlink ships a command line tool that could be used to consume the stream, which I think would be mostly a personal preference. However, a concrete use case might be a nicer libnotify gateway. libnotify allows for notifications to be updated (e.g. you could have a "building" notification that lingered until the build was complete, that then changed to "finished" and expired or "failed!" with a button to open the build log). If Varlink remains internal, that would have to be provided by Lorri, and the problem of adapting libnotify vs. MacOS notifications vs. can Windows display notifications? is teneable on its own, but really out of Lorri's scope. If we expose a limited Varlink interface, other programs can be written to manage that, and Varlink can generate their interface code. More high-flown: I think it's incoherent and unaesthetic to use Varlink to describe a message outside of an interface (i.e. which includes at least one RPC method). As a user of Lorri, if I did want to consume the output of It's arguable that it makes more sense to use Rust structs to serialize the Events out of |
Cross-language, cross-platform, type safe (as far as the language in question allows) APIs: https://varlink.org/Language-Bindings |
Context
As follow on to #320, stabilize and publish the interface for event notifications, so that other programs can consume them.
Proposal
Create a separate Varlink interface (called
com.target.lorri.public
).Migrate the existing Event message and Monitor method from the
com.target.lorri
interface. Remove dependencies on other members of the interface to keep the interface small. For instance,nix_shell
fields becomestring
instead ofNixShell
.Have the daemon continue to serve the Monitor method. Reduce
ops/stream_events.rs
to a simple pass through, reserializing events from the server.lorri stream_events
exists in order to make events available on stdout. The message format and the method on the Lorri daemon socket is part of the Lorri public interface.Credit is due to @curiousleo for the suggestion to use Varlink to describe the event messages.
The text was updated successfully, but these errors were encountered: