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

Memoization of pulumi side effects #429

Merged
merged 6 commits into from
Apr 2, 2024
Merged

Conversation

lbialy
Copy link
Collaborator

@lbialy lbialy commented Mar 30, 2024

Final solution for memo issues.

Copy link
Contributor

@pawelprazak pawelprazak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, LGTM!

I've added couple of suggestions regarding documentation and readability in the interest of future maintainability and preservation of key decisions.

core/src/main/scala/besom/internal/Memo.scala Show resolved Hide resolved
parsed <- parseInvokeResponse(tok, res)
yield parsed
end executeInvoke

private[internal] def resolveMode(options: ResourceOptions): Result[Mode] =
// this order is then repeated in registerReadOrGetResource
options.hasURN.zip(options.hasImportId).flatMap { case (hasUrn, hasImportId) =>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: I'd move this internal logic to the companion object of the Mode and use pat-mat instead of if for readability because it allow for a sort of "table of allowed states"

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can't be patmat, this is async

@pawelprazak pawelprazak added the area/core The SDK's core code label Apr 2, 2024
@pawelprazak pawelprazak added this to the 0.3.0 milestone Apr 2, 2024
@lbialy lbialy merged commit 0673b6c into main Apr 2, 2024
2 checks passed
@lbialy lbialy deleted the memoization-of-pulumi-side-effects branch April 2, 2024 11:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/core The SDK's core code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants