Hi,
I’m a bit confused about the BackendApplicationContribution behavior.
According to the documentation of BackendApplicationContribution.initialize
, “The implementation may be async, however it will still block the initialization step until it’s resolved.” and BackendApplicationContribution.configure
, “Called after the initialization of the backend application is complete.”.
With the following code snippet:
import { BackendApplicationContribution } from "@theia/core/lib/node/backend-application";
import { injectable } from "inversify";
@injectable()
export class BackendContrib1 implements BackendApplicationContribution {
async initialize() {
console.log("BackendContrib1.initialize START");
await new Promise(resolve => setTimeout(resolve, 10000));
console.log("BackendContrib1.initialize END");
}
}
@injectable()
export class BackendContrib2 implements BackendApplicationContribution {
async configure() {
console.log("BackendContrib2.configure START");
await new Promise(resolve => setTimeout(resolve, 3000));
console.log("BackendContrib2.configure END");
}
}
I would expect the following output in the console:
root INFO BackendContrib1.initialize START
root INFO BackendContrib1.initialize END
root INFO BackendContrib2.configure START
root INFO BackendContrib2.configure END
but what I’ve got is:
root INFO BackendContrib1.initialize START
root INFO BackendContrib2.configure START
root INFO BackendContrib2.configure END
root INFO BackendContrib1.initialize END
So it seems that it doesn’t wait for the initialization of all the BackendApplicationContribution before to call configure as indicated in the documentation. Is that intended?
Thanks