|| at Oct 18, 2013 at 1:57 am
On Fri, Oct 18, 2013 at 4:28 AM, Jose wrote:
How can I use the Go http server to serve normal http requests and also
wrap a non thread-safe library ?
My starting point is the example bradfitz posted on how to run the
Ideally, I would also want to use the gorilla/mux library. Any ideas on
how to "handle" this ?
If you want to wrap a non thread-safe library the best option is to have a
single goroutine responsible for it and have other goroutines submit
requests over a channel.
Generally it's best for them to submit their request along with a channel
for the reply.
You don't need to intentionally make the http requests process serially
because all you need is serial access to the library which communicating
with a single goroutine will provide.
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firstname.lastname@example.org.
For more options, visit https://groups.google.com/groups/opt_out.