-
Notifications
You must be signed in to change notification settings - Fork 185
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
feat: WithLocalPublication option to enable local only publishing on a topic #481
Conversation
@@ -1143,7 +1144,9 @@ func (p *PubSub) checkSigningPolicy(msg *Message) error { | |||
func (p *PubSub) publishMessage(msg *Message) { | |||
p.tracer.DeliverMessage(msg) |
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.
Should we trace such local messages or not?
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.
the tracer can see it's a local publication from the Local field -- but we might want to have some special casing in some tracers.
I think we should leave it as for now.
@vyzo, gentle ping. Do you think this is a reasonable publish option? Should we proceed, or close the PR? |
well, i am a little conflicted about it. |
leave it open for now, i'd like to see others in the community chime in as well. |
Got your concern. We don't use PubSub for in-process pubsubing only, but we use it for pubsubing when msgs need to be both delivered to a local instance of some component and remote instances on peers. However, there is an edge case where the local instance is out of sync and only it needs to rcv msgs, s.t. network is not spammed with no more relevant msgs. And we would like to solve this case over the same code path and without the need to spawn another internal pubsubing mechanism specifically for the case. I can give you more details and even point to sources if you want. |
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.
ok, fair enough.
Lets improve the documentation a bit and i will merge.
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!
@@ -1143,7 +1144,9 @@ func (p *PubSub) checkSigningPolicy(msg *Message) error { | |||
func (p *PubSub) publishMessage(msg *Message) { | |||
p.tracer.DeliverMessage(msg) |
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.
the tracer can see it's a local publication from the Local field -- but we might want to have some special casing in some tracers.
I think we should leave it as for now.
An attempt to close #480
We can also sneak here similar cases like an option to publish to the mesh only, so doing something like the code below during validation is not needed anymore: