-
Notifications
You must be signed in to change notification settings - Fork 442
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
public API refactoring #30
Conversation
some of the logger stuff seems a little complicated. One logging setup i've liked for it's exposed API is https://github.com/araddon/httpstream/blob/master/log.go#L29 which i feel like would translate here to
I don't think we need to expose a way to handle or intercept individual messages, and this would be ideal for some of my uses where i embed multiple readers in a program and want to tag log lines with prefixes. |
Yea, struggled coming up with a clean API for it. I'll see how your suggestion turns out. |
RFR @jehiah - updated the logging API |
I've read through this several times, and i think i'm good. What do you want to do here to get this out? |
I assume (hope) that most users of this package, at this point, are aware of the importance of pinning dependencies (whether vendored or managed). So I think the best choice is to plow ahead:
Agreed? |
BTW, how do you feel about renaming |
Sounds good. Avoiding the confusion of those overloaded terms would be good. It's a naming change that should prob cary through to other client libraries |
…me.Duration for Requeue
ok, bumped master to stable v0.3.7, RFM @jehiah |
I just realized this dropped SetMaxInFlight which is intentionally exported so that you have an api to pause and resume a Consumer. |
Reader
properties into annsq.Config
struct, with no public members, that exposesSet(key string, value interface{})
(this method will leverage the pre-existingConfigure(...)
code to coerce values into the right types)Message
commands (FIN
,REQ
,TOUCH
)FinishedMessage
code)Message.{FIN,REQ,TOUCH}
methods rather than interpret the return value from the handlerSendCommand
and buffering such that users ofConn
flush explicitly (and theConn
has abufio.Writer
)Reader/Writer
(which have pre-existing golang conventions) toConsumer/Producer
Writer
error handling (so you dont have to checkerr
andframeType
)s/msg.Write/msg.WriteTo
to satisfyWriterTo
and removemsg.EncodeBytes()
(you can useWriteTo
)binary.{Read,Write}
(slow)SetHandler
overAddHandler
and addHandlerFunc
convenience typeSetMaxInFlight
,ConnectionMaxInFlight
, etc.The last two will result in a public API that mirrors the same changes we made to
pynsq
which some confusion and ambiguity.