-
Notifications
You must be signed in to change notification settings - Fork 6
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
Publisher and Sender interface overlap #87
Comments
There is no overlap. This is just a confusing use within the index-provider. The index-provider's publishers use an HTTP sender that sends direct announcements to the URLs configured for the engine to send to. The
This comment here is wrong: // * engine takes pubHttpAnnounceAddrs option to allow configuring which addrs should be announced.
// But those addrs are only used by the bespoke sender, _not_ the HTTP sender inside publishers. In fact the ConclusionThe code in index-provider appears to be correct, and I have created a PR to update the comments. A new method to allow the HTTP sender to send to alternate destination URLs does not work, since that engine's publisher may not be configured with an HTTP sender, and direct announcements can only be sent using the HTTP sender (pubsub sender cannot send direct). DetailsIn indexer-provider an HTTP sender is created here, and a pubsub sender is created here if configured. Note: The HTTP sender is created with If the publisher is an HTTP publisher, it is given this set of senders here When the publisher's When using an HTTP publisher, it is necessary to explicitly put the provider's URL, where the advertisements are available at, into the announcement message. This is done here with |
@gammazero I think the point got missed: I'd also add: if the engine is doing the announcing part, can that announcing be removed from the Publisher so that it only handle the sync part? That would greatly reduce the complexity of Those two things would greatly reduce the coupling between the engine and |
The Announce methods are not being used, and the UpdateRootWithAddrs is only being used because the Publisher is also doing the announcing (an not exposing its senders). The coupling between publisher and senders is not necessary, and was only done more as a convenience so that updates would automatically sending announcements. I will separate the senders from the publisher so that sending announcements is completely independent of publishing (serving) the advertisements. Thank you for helping me understand what you are looking for. |
Awesome, thank you. |
@MichaelMure, @masih Here is a PR for index-provider that separates the publisher from the sender: ipni/index-provider#392 @masih Given the above, it now makes sense to separate the publishers from the senders in go-libipni. There is no strong reason to associate a set of announce senders with a publisher. The only association is that a sender is often used to after updating the publisher's head CID. |
It seems publisher and sender overlap in terms of interface. in index-provider library announce methods in publisher interface are never called and instead senders are used. Do we need to revise this interface?
https://github.com/ipni/go-libipni/blob/9116d75b32601f01dc7d42ba0e5d9c47b3ca1a67/dagsync/interface.go#L20C1-L26
The text was updated successfully, but these errors were encountered: