Skip to content
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

chore: improve class hierarchy or sdk protocols vs core protocols #2033

Open
weboko opened this issue Jun 4, 2024 · 2 comments
Open

chore: improve class hierarchy or sdk protocols vs core protocols #2033

weboko opened this issue Jun 4, 2024 · 2 comments
Labels
debt Technical debt marker enhancement New feature or request

Comments

@weboko
Copy link
Collaborator

weboko commented Jun 4, 2024

This is a change request

Problem

As of now we have convoluted class structure when:
FilterSDK.super -> BaseSDK.core -> FilterCore.super -> BaseProtocol

Proposed Solutions

Let's revisit it and try to remove extra steps in that chain.

Notes

Original threads: #2003 (comment) and #2003 (comment)

@weboko weboko added enhancement New feature or request debt Technical debt marker labels Jun 4, 2024
@weboko
Copy link
Collaborator Author

weboko commented Jun 5, 2024

ping @danisharora099 to share his experience with this and thoughts

@danisharora099
Copy link
Collaborator

danisharora099 commented Jun 5, 2024

Right. Taking an example of LightPush for an analogy, that we can extend to other protocols:

LightPushCore extends BaseProtocol (has existed)

This is essential for mostly two things currently:

  • Stream Management -- getting a stream from a connection to the peer
  • getPeers() -- getting connected peers, for the relevant pubsub topic & protocol

Introduction of BaseProtocolSDK -- let's call it PeerManager for now

This module was introduced simply for peer management for each protocol.
This is responsible for maintain a pool of peers, and functionalities like renewing peers. This is similar to the functionality expected from BaseProtocol. Perhaps a merge of these two files, into PeerManager looks like the way ahead.
We can rename BaseProtocolSDK to be PeerManager, which at this point, seems more appropriate and reliable.

Conclusion

I'd go so far to say we can remove BaseProtocolCore in favour of moving functionalities into PeerManager.

Action points I'd derive for this issue:

  • rename BaseProtocolSDK to PeerManager
  • remove BaseProtocolCore, and move logic into PeerManager

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
debt Technical debt marker enhancement New feature or request
Projects
Status: To Do
Development

No branches or pull requests

2 participants