Save progress in an ENV variable and poll the machine via the machine API
I would like to avoid relying on webhooks for now. What would be the best way to update ENV variables so that they’re also reflected through the machine API? Do we have to send an update call to the fly API or is there another way?
Updating envs could trigger machine restart but metadata can be dynamically set from within (machines already can do that, auth is already set) and from outside the machine and you can retrieve those as easily as well.
If I may also offer a more near-real-time solution we ship logs via NATS. That means if your machine can write logs such as Task 123 Progress: 10% or even raw json like {"type": "task_progress", ...} and you listen to logs from another machine or even an outside from fly server you can get ordered message updates.