batch
batch copied to clipboard
return number of processed items and Abort error
@matryer Thanks for this little code which makes go shine.
I have decided to send a PR rather than creating an issue. I just wanted to know your opinions.
I have separate them in two commits.
The first one emphasized on returning Abort error. I feel like returning an Abort is the same as all items has been processed. There is no way to indicate whether all is done or it is been aborted.
The second commit focus on returning the number of processed items in batch. Similar to io.Reader.Read()
which returns the number of bytes that has been read.
any thoughts on that? cheers
@alinz I think you're absolutely right that you would want the Abort error returned. @dahernan and I discussed returning the count and I think it's a nice addition. I'll look over this tomorrow in detail. Thanks.
@matryer just wanted to see if this PR worth merging? if not let's close it.