Skip to content

Conversation

@pankaj-bind
Copy link

Hey team,

I've been looking at how we handle endpoint parsing, and I saw an opportunity to make it more flexible and easier to extend. This PR refactors the endpoint handling logic to be more modular, which should make it easier for us and other developers to add custom endpoint types in the future.

What's new?

  • Modular endpoint parsing: I've introduced an abstract base class for endpoints in daphne/endpoints.py and created concrete classes for TCP, UNIX, and File Descriptor endpoints. This makes the code cleaner and opens the door for custom endpoint parsers.
  • Updated tests: The CLI tests in tests/test_cli.py have been updated to work with the new modular design. I've also added a new test case to show how a custom endpoint parser can be added and used.

This change doesn't alter any existing functionality, but it makes the codebase more robust and extensible for future development. I think this will be a great improvement for anyone looking to use Daphne in more advanced setups.

Let me know what you think!

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.

1 participant