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

Allow middlewares between writer and reader #19

Merged
merged 4 commits into from
Sep 26, 2024

Conversation

paupm
Copy link
Contributor

@paupm paupm commented Sep 13, 2024

Adding the option to configure middlewares between the writer and the reader.

Some notes:

  • I get rid of the type messages.Ack (so all channels now are of type Message, the ack information is stored in the message body as a uint8
  • If we move forward with this propose, we have to update the chart so we can configure the new middlewares: https://github.com/softonic/homing-pigeon-chart

pkg/main.go Outdated Show resolved Hide resolved

go reader.Start()
go middleware.Start()
go requestMiddleware.Start()
go responseMiddleware.Start()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't the response be initiated after the writer?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't believe is needed, since the response middleware will wait for messages the writer have to send, then do whatever it has to do and finally send the data to the reader.

@paupm paupm requested a review from joskfg September 18, 2024 14:12
@paupm paupm merged commit 03e5b2c into master Sep 26, 2024
2 checks passed
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.

2 participants