Skip to content

Commit

Permalink
add callback function support for generator scheduling
Browse files Browse the repository at this point in the history
  • Loading branch information
dwarakaprasad committed Mar 9, 2024
1 parent 0218d49 commit 0728fb7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/environment-base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ export default class EnvironmentBase extends EventEmitter implements BaseEnviron
const { schedule = true, ...instantiateOptions } = options;

const generatorInstance = await this.create(generator, instantiateOptions);
return this.queueGenerator(generatorInstance, { schedule });
return this.queueGenerator(generatorInstance, { schedule: typeof schedule === 'function' ? schedule(generatorInstance) : schedule });
}

/**
Expand Down

0 comments on commit 0728fb7

Please sign in to comment.