#Can't call Service.Sync()
1 messages · Page 1 of 1 (latest)
Are you looking for Service.Stop()? Or what is the goal?
Run the service, basically. I expect the call to never return (only be interrupted eventually when the user Ctrl-Cs)
Before 0.9., I achieved this with Container.Sync
I guess the equivalent is Start now?
Oh! Start doesn't wait for the service to finish. Yeah.. seems like a single call which starts the service and waits is not there in the service type
I think that's actually OK (at least in Go), I can call Start() then block manually on the context
Since it's not listening on a port, would you still use Container.Sync and dagger call instead of Service/up?
Maybe. I was wondering that.
But now that I got my function working with dagger up (by exposing a bogus port), it feels right to have it be a service
It does pose the question of what exactly is and isn't a service
If I had my function return a *Container instead, and made no other change, I would lose the ability to run that container from the CLI, since there is no dagger run that takes a function returning a container, and runs that container
Ie:
-
dagger up -m github.com/shykes/daggerverse/tailscale gateway--> this works right now 🙂 -
dagger call -m github.com/shykes/daggerverse/tailscale gateway-> this wouldn't do anything, I think
Maybe dagger up should support Container in addition to Service, and just run the container as is?