scalaz/scalaz-stream — pull request #140 by pchlupacek (2014-03-21 08:19:27+00:00)
Title: Wye drain fix

@pchiusano, @fthomas

Apart form bumping to 2.10.3 and 7.0.6, this fixes couple of issues in async code that I think shall be part of 0.4.0.

Namely these are the changes:

- new implementation of runAsyncInterruptibly. Old implementation incorrectly handled situations when left or right side was `drained` . Now this is handled correctly. Both MergeN and Wye was affected
- new implementation (in contrast to old one) assures that cleanup is called when the process is interrupted on both the `inner` and `outer` case of Await (inner means, after evaluating the request, that may or may not happen). That way we always run the cleanup to opened resources at least once.
- added `idempotent` combinator on `Process`
- assured the onComplete, onFailure, append and fby `p2` argument is cached, that means is evaluated only once when appending it to `Await`, current implementation always run `p2` function and that way `idempotent` combinator was useless
- `async.toSignal` now correctly behaves when passed with process that has some side-effects included
- `topic has now optional constructor parameter `source`. Its actually quite useful, and I think it gives us opportunity to introduce later `split` and `splitBy` combinators on `Process[Task,O]` in favor to topicXXX
- some small tweaks in tests.

Please LMK if this is GTM.

P.