Open im7mortal opened 2 months ago
Wouldn't it be worth implementing a wrapper in the style of the command framework from this pull request? Of course, with more abstraction.
Yes probably, there's probably enough plugins in the pulumi/pulumi sdk to get a good feel for what's needed here. Pretty much just search for all the places we currently use rpcutil.ServeWithOptions
.
I've looked into it before and couldn't quickly come up with a good way to express the abstraction given the tools Go gives you, but it might be possible with some more thinking.
The CMDs which will have the wrapper.
Hello!
Issue details
Regarding standard cmd framework from #17129. We have many gRPC servers that share the same logic: creating the gRPC server with standard or provided options, setting live checks, setting tracing handlers, starting the server, printing the port, and performing a proper shutdown. pulumi-language-java, pulumi-language-dotnet, pulumi-language-go, pulumi-language-python, pulumi-language-nodejs.
There are likely more instances where this logic is duplicated.
Additionally, this same approach should be applied for Golang policy and any future gRPC plugins.
Wouldn't it be worth implementing a wrapper in the style of the command framework from this pull request? Of course, with more abstraction.