Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Turn CliIoHost singleton pattern into an IoHost class which is specific to a Toolkit Instance #32816

Open
mrgrain opened this issue Jan 9, 2025 · 0 comments
Assignees
Labels
@aws-cdk/core Related to core CDK functionality cli Issues related to the CDK CLI effort/medium Medium work item – several days of effort p2

Comments

@mrgrain
Copy link
Contributor

mrgrain commented Jan 9, 2025

CliIoHost exists today as a singleton pattern. However this creates an issue if someone wanted to do parrallel executions of the Cli i.e.

Promise.all([
    myToolkit.deploy(appA),
    myToolkit.deploy(appB)
]);

or if someone wanted to maintain multiple distinct copies of the tookit

const myAwesomeToolkitA = new Toolkit({
    ioHost: myCustomIoHost()
})

const myAwesomeToolkitB = new Toolkit({
    ioHost: myOtherCustomIoHost()
})

This is done if:

  • The singleton pattern is gone
  • Anywhere the the Cli was calling a log function i.e. info() is now changed to a IoHost.notify().
  • Log functions should return a formatted IoMessage, i.e. IoHost.notify(info('my message')) or some equivalent functionality

Singleton Implementation Pr:
#32708

@mrgrain mrgrain added the p2 label Jan 9, 2025
@khushail khushail added @aws-cdk/core Related to core CDK functionality cli Issues related to the CDK CLI effort/medium Medium work item – several days of effort labels Jan 9, 2025
@HBobertz HBobertz changed the title Enable parallel toolkit executions by removing singleton pattern Turn CliIoHost singleton pattern into an IoHost class which is specific to a Toolkit Instance Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/core Related to core CDK functionality cli Issues related to the CDK CLI effort/medium Medium work item – several days of effort p2
Projects
None yet
Development

No branches or pull requests

3 participants