backend-{plugin,app}-api: introduce startup hooks and parallelize initialization

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2023-05-24 15:55:26 +02:00
parent c4e8fefd9f
commit 3bb4158a8a
10 changed files with 256 additions and 76 deletions
@@ -35,7 +35,10 @@ describe('createBackend', () => {
createServiceFactory({
service: coreServices.rootLifecycle,
deps: {},
factory: async () => ({ addShutdownHook: () => {} }),
factory: async () => ({
addStartupHook: () => {},
addShutdownHook: () => {},
}),
}),
],
}),
@@ -49,12 +52,18 @@ describe('createBackend', () => {
createServiceFactory({
service: coreServices.rootLifecycle,
deps: {},
factory: async () => ({ addShutdownHook: () => {} }),
factory: async () => ({
addStartupHook: () => {},
addShutdownHook: () => {},
}),
}),
createServiceFactory({
service: coreServices.rootLifecycle,
deps: {},
factory: async () => ({ addShutdownHook: () => {} }),
factory: async () => ({
addStartupHook: () => {},
addShutdownHook: () => {},
}),
}),
],
}),