Each of these is different, but the differences are subtle.
The onComplete
parameter of unicast
lets you setup a callback for when the Iteratee that it is applied to completes successfully. The separate onError
callback is for when it fails.
The onDoneEnumerating
method of Enumerator
lets you attach a callback that will be called if the Iteratee
either completes successfully or fails.
Iteratee.map
allows you to attach a callback to an Iteratee
that completes successfully, and alter the value that it completes with.
Concurrent.broadcast
doesn't take onComplete
or onError
callbacks because it can be applied to multiple Iteratee
instances, which won't necessarily behave the same way. One instance may die with an error, while another one completes successfully at a later time, while another never completes. Because of this it is unlikely for it to make sense for the code running the Enumerator to react to these events.