-
Notifications
You must be signed in to change notification settings - Fork 335
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
Task Server Protocol #1457
Comments
I was a bit surprised by this. I thought the tasks were usually short-lived operations that just run one or more commands in a certain order and then just end. The TSP seems to indicate this is a long lived process that can interactively start one or more tasks. It almost seems like the protocol could be used for the That's pretty cool, I'm just wondering what the intention is. Just to illustrate, the same could be done by That said, the methods/responses make sense to me. I just wasn't sure where the tsp would get its configuration from if that resides in devenv.nix? Nitpick (feel free to ignore): The stderr being bool was a bit surprising, but the alternatives I thought up might not be better ( |
@bobvanderlinden you're correct to spot the intention for tasks to be an implementation detail for processes. That way we get systemd-level dependency trees also for processes.
There are two issues here when I was thinking about the design:
it gets configuration from initialization phase that happens as soon as executable runs.
I had the same thought, the alternative would be |
See #1471 |
Very interested in this! I've built a PoC for Clojure (with a GraalVM target, for startup speed). Maybe this is a way to marry babashka tasks (common in the Clojure world) and making them available to devenv. So a "devenv up" would just work(tm) for Clojure devs. |
@bennyandresen happy to code up the TSP if you'd like to take this forward and test! |
Yeah, very much so. Just thinking out loud for Clojure/babashka integration, in case others are also interested in this. So in my mind, based on my PoC given this description one could use metadata inside a As an example, a normal {:tasks
{test
{:doc "clojure -Srepro -M:poly test <args>"
:task (apply poly "test" *command-line-args*)}
test-all-verbose
{:doc "bb test :all :verbose"
:task (poly "test" :all :verbose)}
outdated
{:doc "clojure -Srepro -M:outdated"
:task (clojure-repro "-M:outdated")}}} you could then add My imagined use case would be to export the processes inside Clojure metadata also allows to give parameters, so one could indicate whether or not one wants to export a task or a process to devenv. |
Task Server Protocol
https://devenv.sh allows defining tasks in your favorite language using JSON-RPC
protocol and exposing them as an executable :
Listing tasks
Which would launch
myexecutable /tmp/rando.sock
anddevenv
would on startup immediately ask for a list of tasks:And the server responds:
Running tasks
Then the client can ask the server to run a task:
And server streams updates about stdout/stderr:
Until the final response from the server with outputs and the final status of the task.
Rust SDK
Implementation
The text was updated successfully, but these errors were encountered: