-
Notifications
You must be signed in to change notification settings - Fork 3
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
Make examples more representative #1
Comments
So, do you have any concrete suggestions? The problem description is pretty vague. |
I think it would go a long way to just make sngecomm.go concentrate on header munging and default values rather than convenience methods that obfuscate the generation of the necessary headers for what's really necessary to use the library in its current form So, then, instead of // in subscribe.go
sngecomm.Subscribe(conn, d, i, "auto") you have h := stompngo.Headers{"destination", d, "ack", "auto"}
idField := sngecomm.ConnNeedsID(conn, i)
if idField != nil {
h.add(idField...)
}
conn.Subscribe(h) Then it's pretty clear that headers (and conforming them to the spec) is what using stompngo is all about. It just seems like sngecomm.go is almost like another STOMP framework unto itself, which I guess is fine, if part of the example is telling people they need to set up their own convenience libraries, but the examples just look nothing like how you would actually use the library. EDIT: I've changed the title of the issue to more accurately reflect the point I was trying to get across. |
I will easily admit this examples package is a bit chaotic. It was quickly slapped together when the main stompngo was being completed. And has grown without much (if any) thought given to 'design/architecture'. I am going to suggest that you make a few changes of the sort you would like to see, and send me pull requests. |
Righto. I'll branch it or something. |
If you clone, make sure you stay up to date. I will try to get a small RECEIPT example in soon. And have one other change almost ready. |
These examples are nice and exhaustive, but they rely so heavily on shared, external methods, that it can be difficult to figure out what's going on
The text was updated successfully, but these errors were encountered: