Skip to content

Commit

Permalink
common: fix zygote opts
Browse files Browse the repository at this point in the history
  • Loading branch information
koush committed Aug 1, 2024
1 parent 4c3f1c4 commit 962ecf2
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions common/src/zygote.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,16 @@ import os from 'os';

export type Zygote<T> = () => PluginFork<T>;

export function createZygote<T>(name: string): Zygote<T> {
let zygote = sdk.fork<T>();
export function createZygote<T>(name?: string, filename?: string): Zygote<T> {
const opts = {
name,
filename,
};
let zygote = sdk.fork<T>(opts);
function* next() {
while (true) {
const cur = zygote;
zygote = sdk.fork<T>({
name,
});
zygote = sdk.fork<T>(opts);
yield cur;
}
}
Expand Down

0 comments on commit 962ecf2

Please sign in to comment.