I'd like to open the first available debugging port and wait for client to attach before I continue execution, so I do:
inspector.open(0, undefined, /* wait */ true);
This results in a logical deadlock though: in order to get the inspector.url(), I need to continue execution. But execution only continues when connection is established over that exact URL I can't get. It makes me think that inspector.open does not really make sense with the wait === true.
Could this API be changed to something like below instead?
inspector.open(0, undefined, true, ({url}) => {
clientPipe.send(url); // <-- reports url
});
// <-- blocks execution.
@eugeneo, @ak239