Fix starting of lens proxy

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton committed 2023-01-10 15:18:11 -05:00
1 parent e49b0f61ce
commit d173e45177
4 files changed
+72 -54

No files matched your search

+24
View File
@@ -0,0 +1,24 @@
/**
* Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information.
*/
export type Starter = (signal: AbortSignal) => Promise<void>;
export interface SingleStartable {
start: () => Promise<void>;
stop: () => void;
}
export function getSingleStartable(id: string, start: Starter): SingleStartable {
const controller = new AbortController();
return {
start: async () => {
await start(controller.signal);
},
stop: () => {
controller.abort();
},
};
}