gorequest icon indicating copy to clipboard operation
gorequest copied to clipboard

Concurrent Requests.

Open whitebook opened this issue 9 years ago • 7 comments

How does this library handle concurrency?

Like multiple simultaneous requests?

Is there an example?

Looks like fun.

Thanks.

whitebook avatar Apr 21 '15 02:04 whitebook

As long as you create a new gorequest object, concurrency will be fine. But that is pretty inefficient, The Request object internally holds http.Client. As per the godoc a single client is enough to handle concurrent requests.

gdrte avatar Aug 14 '15 18:08 gdrte

@whitebook I encountered fatal error: concurrent map writes when using single gorequest object for all my POST requests. As you see from error (and what I can see on the line indicated by error dump) it is caused by setting headers using Set(string, string).

It would be great if it would be handled internally by gorequest but then again I don't see a big issue having a dedicated goroutine for gorequest(s).

awdrius avatar Feb 23 '16 23:02 awdrius

+1 for handling concurrent requests through GoRequest

bthibault avatar Mar 05 '16 13:03 bthibault

+1 for handling concurrent requests through GoRequest

Wang-Kai avatar Apr 12 '18 05:04 Wang-Kai

Is this project still maintained? If so, is anyone still interested in this feature? Just asking for hacktoberfest, I'd gladly take this one.

empijei avatar Oct 01 '18 11:10 empijei

As a http client library , i think this feature is necessary

Wang-Kai avatar Oct 02 '18 10:10 Wang-Kai

Any word on this? I'm getting the same crash while making concurrent requests.

vdods avatar Dec 22 '18 00:12 vdods