Remove usage of channels for ForEach #90

Merged
carlosmn merged 2 commits from unchanify into master 2014-05-07 08:12:00 -05:00

2 Commits

Author SHA1 Message Date
Carlos Martín Nieto 7e3c361ac4 Packbuilder: use a callback for ForEach instead of a channel
Channels provide no means to report an error. Closing a channel could
mean anything.

This is particularly important when dealing with IO, which we do quite
often in the pack builder. Use ForEach which returns an error instead.
2014-05-06 14:43:38 +02:00
Carlos Martín Nieto 2594f3f889 Odb: use a callback instead of a channel for ForEach
A channel provides no way to specify whether we stopped sending data
because of an error or because there is no more data.

Therefore, make Odb.ForEach() take a callback with which the user is free to
do whatever they need, letting us return en error.
2014-05-06 14:19:34 +02:00