Closed oliverpool closed 7 years ago
Since DoChannel
is called by DoBatch
, testing DoBatch
automatically tests DoChannel
;-)
One issue is that the workers
will block if the responses
channel is full (this occurs for batch requests as well).
A possibility would be to pass the receiving channel as argument (as recommended by https://inconshreveable.com/07-08-2014/principles-of-designing-go-apis-with-channels/) or at least document this behavior.
Specifically, breaking principle 4?
Fix #12.
I simply made a copy/paste of
DoBatch
. Now myDoBatch
looks like this:It is the callers responsibility to close the
reqs
channel.