Stephen R. van den Berg wrote:
Stephen R. van den Berg wrote:
I now have an API that works roughly like this:
The API has since reached beta-stage and is now included in Pike 8.1 (it has a synchronous, a callback *and* a promise interface). Documentation is a little bit skimpy at the moment. But a working minimal example is included in the docs.
My Google Compute Engine herd-orchestrator/autoscaler (for cheap preemptive instances) works like a charm now.
The promise interface I added to the Google API interface works thus that if you replace the callback argument with the string "promise", that it will return a Promise.
Given the constraints of the dynamic API definitions, this was the best I could come up with. If anybody has any better ideas, please let me know.