-
Notifications
You must be signed in to change notification settings - Fork 7
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
Conversation
There was a problem hiding this 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.
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) => |
There was a problem hiding this comment.
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"
There was a problem hiding this comment.
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
Final solution for memo issues.