hypothesis/h — pull request #1736 by tilgovi (2014-11-29 00:29:12+00:00)
Title: Refactor the queued streamer a bit

This change refactors the queued streamer to hopefully make it a bit
simpler in a few places.

- Rather than having `get_reader` and `get_writer` be both request
methods and configurator directives just use request methods. This
eliminates the nasty partial stuff.
- Pass the settings to the IQueueHelper implementation rather than
on every call to `get_reader` or `get_writer`.
- Store the queue as a class attribute of the `StreamerSession`.
- Start and stop the reader when the first and last clients connect
and disconnect, respectively.
- Skip including the streamer module entirely when the feature is
disabled, by moving that check to the h module include.
- Register an instance of `IQueueHelper` rather than the class itself.
Otherwise, we would name the interface `IQueueHelperClass`. Add
the zope.interface.implements decorator to the implementations to
make this more clear. Looking up a utility by an interface should
always give an instance of something which implements that interface,
not a factory or constructor for it.