github/ReactiveCocoa — pull request #101 by Coneko (2012-11-04 10:22:55+00:00)
Title: Subject to support producer-consumer pattern.

I added a subject to support a producer-consumer pattern. While it adds a sort of pull based behaviour to a push based framework, I thought it useful enough to merge upstream.

I called it `RACStashSubject` instead of the more obvious `RACBufferSubject` to avoid confusion with ``'s `-buffer` methods.

I didn't write it as a subclass of `RACReplaySubject`, despite it being pretty much the same thing, because it doesn't conceptually add any functionality to it, but rather removes some of it, I figured a subclass should at least do what it's superclass does. I can change that if it's not a good idea, or if code reuse trumps it. (It is pretty much the same code in the two classes after all)

I also didn't give it a `capacity` property because I thought it wouldn't make much sense. If the subject represents a changing value, you're probably only interested in the last one. If it represents a signal, you wouldn't want to lose any part of it along the way.