Skip to content

Add http/2 support#17

Open
aryamansingh2008 wants to merge 1 commit intoThreeDotsLabs:masterfrom
aryamansingh2008:add-http2-support
Open

Add http/2 support#17
aryamansingh2008 wants to merge 1 commit intoThreeDotsLabs:masterfrom
aryamansingh2008:add-http2-support

Conversation

@aryamansingh2008
Copy link

@aryamansingh2008 aryamansingh2008 commented Dec 25, 2025

Motivation / Background

The current subscriber implementation directly constructs a net/http.Server, which tightly couples the subscriber to a single HTTP server implementation.

While this works well today, it makes it harder to extend the subscriber to support alternative server setups and customise server behaviour without modifying core subscriber logic.

Details

This PR introduces a small abstraction to decouple server creation while keeping backward compatibility.

Alternative approaches considered (if applicable)

Exposing http.Server directly in config. Avoided because

  1. Server address currently passed in subscriber constructor would be duplicated in server construction causing confusion. Avoiding this would break backward compatibility.
  2. Ownership of net/http.Server becomes unclear.

Checklist

  • I wrote tests for the changes.
  • All tests are passing.
    • If you are testing a Pub/Sub, you can start Docker with make up.
    • You can start with make test_short for a quick check.
    • If you want to run all tests, use make test.
  • Code has no breaking changes.
  • (If applicable) documentation on watermill.io is updated.

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