Fork me on GitHub

a question about pipeline-async. It says in the docs ( that: A: af must be a function of two arguments, the first an input value and the second a channel on which to place the result(s) B: af must close! the channel before returning C: the presumption is that af will return immediately, having launched some asynchronous operation (i.e. in another thread) whose completion/callback will manipulate the result channel isn't this somewhat contradictory? Af should return immediately and make sure to close the result channel before it does so...but the result will be calculated asynchronously and might take time to do we both "return immediately" and "produce result on the channel later"? I think I'm missing something fundamental here...


no the call to close! should happen some time later whenever the async operation called by af has finished


the point of af @mbjarland is to fire off some sort of async thask, then af returns, and sometime in the future data will be put onto the chan and then the chan will be closed.


so isn't B above incorrect then? (and apologies for potentially being a bit thick here)...


yes, B is incorrect


ok, glad to hear I'm not going crazy. The above is straight from the docs, there might be room for improving the wording in the docs it seems


@tbaldridge thanks for the clarification