Hi, Probably not the answer you were expecting, but :
> The nonces must be received by the host in ascending order. is going to fail sooner or later, no matter which trick/feature you use. A more robust solution would be to code the server to accept unordered requests and handle them gracefully. To give you a concrete example or where such assumption/requirement fails: 1. first requests goes out 2. server starts reading the request including the nonce 3. second request goes out with a new nonce 4. the network from req 1 fails so the server did not finish reading the complete payload 5. req from step 3 finishes Now the server **doesn't** have req 1. The higher the concurrency, the higher the chances of this issue from happening and being harder to handle from the client side. Or , would something like this https://github.com/savaki/snowflake help you by creating unique IDs with *some* ordering? Final question, is the nonce used anywhere as a cryptographic IV/Salt/etc? If so, I wouldn't use an ID that increments, but instead use something really random, like crypto/rand Regards, Diego On Tuesday, September 26, 2017 at 1:40:38 AM UTC-4, Donovan wrote: > > Hi, > > I have an interesting problem where I need to make a rapid series of HTTP > requests to the same host, each with a nonce which increments with each > request and a signature of the request body including that nonce, but I > don't want to wait for the response before sending the next request. The > nonces must be received by the host in ascending order. > > I've tried this using standard library HTTP requests, each running in > separate goroutines with a time delay before releasing the next nonce, to > try and ensure that the requests are sent in order, but this fails > intermittently, possibly due to network delays. I've also looked at > PipelineClient with MaxConns set to 1, which seems closer to what I need, > but it would still require an asynchronous response to prevent blocking > between request dispatches. > > https://godoc.org/github.com/valyala/fasthttp#PipelineClient > > Has anyone battled a problem similar to this before? Any ideas much > appreciated! > > Cheers, > Donovan. > -- 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 golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.