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

Using io.Reader for Transport interface instead of []byte #40

Closed
karthikmuralidharan opened this issue Aug 5, 2017 · 2 comments
Closed

Comments

@karthikmuralidharan
Copy link

karthikmuralidharan commented Aug 5, 2017

Hi,

I love the idea of this package and want to use it for a new service I'm working on with SQS integration.

I was wondering if it made sense to use io.Reader as the message type instead of directly using []byte for this package?

So that we could directly pass the messages along to different decoders as necessary.

https://medium.com/@matryer/golang-advent-calendar-day-seventeen-io-reader-in-depth-6f744bb4320b

@matryer
Copy link
Owner

matryer commented Aug 10, 2017

We did explore this in the early design, and just felt that []byte more accurately represented what was really going on. I think we'd end up reading everything into a buffer anyway, so the io.Reader would just be sugar, rather than being useful as a streaming protocol. And I was worried people would deliver gigantic payloads through the queue, which isn't recommended. Messages should be small and discrete.

@matryer
Copy link
Owner

matryer commented Aug 15, 2017

@dahernan What do you think?

@matryer matryer closed this as completed Dec 12, 2017
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

2 participants