Skip to content

go: add messager container provider#109

Merged
wenchy merged 9 commits intomasterfrom
go-messager-container-provider
Nov 29, 2025
Merged

go: add messager container provider#109
wenchy merged 9 commits intomasterfrom
go-messager-container-provider

Conversation

@Kybxd
Copy link
Copy Markdown
Collaborator

@Kybxd Kybxd commented Jul 16, 2025

No description provided.

@Kybxd Kybxd marked this pull request as draft July 16, 2025 09:32
@Kybxd Kybxd force-pushed the go-messager-container-provider branch from cd647b2 to c62681c Compare July 17, 2025 03:00
@Kybxd Kybxd force-pushed the go-messager-container-provider branch 2 times, most recently from 3792631 to 0b02b55 Compare September 11, 2025 07:37
Comment thread test/go-tableau-loader/main.go Outdated
fmt.Printf("PatchReplaceConf: %v\n", hub.GetHub().GetPatchReplaceConf().Data())
// print provided patch replace conf
fmt.Printf("PatchReplaceConf(provided): %v\n", hub.GetHub().ProvidedBy(ctx).GetPatchReplaceConf().Data())
// print patch replace conf binding to background context
Copy link
Copy Markdown
Member

@wenchy wenchy Sep 11, 2025

Choose a reason for hiding this comment

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

Please obey the context API convention amd design elegant APIs:

  • ctx := hub.GetHub().BindTo(ctx) -> ctx = hub.NewContext(ctx, myhub)
  • myhub := hub.GetHub().ProvidedBy(ctx) -> myhub = hub.FromContext(ctx)

Refer to https://pkg.go.dev/context#Context
image

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

We do not bind a hub to context, but bind its messager container. ctx = hub.NewContext(ctx, myhub) will lead to misunderstanding.

Comment thread cmd/protoc-gen-go-tableau-loader/embed/templates/base_hub.pc.go.tpl Outdated
@Kybxd Kybxd force-pushed the go-messager-container-provider branch from ab84add to 6c14902 Compare November 28, 2025 12:28
@Kybxd Kybxd force-pushed the go-messager-container-provider branch from 6c14902 to 71a7511 Compare November 28, 2025 12:31
@Kybxd Kybxd force-pushed the go-messager-container-provider branch from 07781cd to 40712e0 Compare November 29, 2025 09:31
@Kybxd Kybxd marked this pull request as ready for review November 29, 2025 10:29
@Kybxd Kybxd requested a review from wenchy November 29, 2025 10:29
@wenchy wenchy merged commit 14bcd5f into master Nov 29, 2025
@wenchy wenchy deleted the go-messager-container-provider branch November 29, 2025 13:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants