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

Code cleaning on sdx_controller/messaging subfolder #249

Open
italovalcy opened this issue Mar 27, 2024 · 3 comments
Open

Code cleaning on sdx_controller/messaging subfolder #249

italovalcy opened this issue Mar 27, 2024 · 3 comments
Assignees

Comments

@italovalcy
Copy link
Contributor

As discussed on PR #223 (#223 (comment)) there is opportunity to review the code under sdx_controller/messaging subfolder and remove unused code. I'm opening this issue here so we can discuss this and see if it makes sense or not to keep the code there.

Cc'ing @congwang09, @YufengXin and @sajith to provide comments.

@sajith
Copy link
Member

sajith commented Mar 28, 2024

@italovalcy Thank you for raising this. I agree, that code should be refactored and simplified. I think these are the steps we should take:

  • Removing unused code would be a good first step.
  • Reviewing, updating, documenting, and adding some tests for the remaining code would be the the next step.
  • There's some tight coupling of functionality, such as message handling and processing is done in a single method. Removing the coupling, and refactoring it into smaller, simpler methods would be useful.
  • We also create a thread within a thread (here). I'm not sure if we need it anymore (it was added before sdx-controller became a "proper" WSGI app). We should figure out the correct way.

Broadly, I think we just need a subscribe() method (which receives messages and pushes them to a queue for subsequent processing) and a publish() method (which sends messages to LCs). We could hash out the details during refactoring.

If done right, we can reuse the final subscribe() and publish methods in sdx-lc as well. I was thinking we could pull the code out into a library ("sdx-base" perhaps, along with other assorted utility methods that both sdx-controller and sdx-lc can share), but perhaps that might be overkill, if the amount of final code is pretty small.

@YufengXin
Copy link
Collaborator

into the 'datamodel' repo? transformed to be the 'sdx-base'? just a thought.

@sajith
Copy link
Member

sajith commented Apr 15, 2024

Not sure. We should do the refactoring first, and then evaluate if we need a library at all.

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

No branches or pull requests

4 participants