added timeout operator

Regarding the concurrency issues I mentioned, please rewrite this whole method using `take(timespan: FiniteDuration)` as inspiration. It's probably less efficient than it could be, but correctness has a priority over efficiency.