Halting a pipe

A discussion currently taking place that may also interest you (and mentions a design pattern that does exactly what you want) can be found here: