locustio/locust — pull request #122 by kekssw (2013-12-28 09:35:01+00:00)
Title: Detect non-locust classes based on "client" property rather than on global _internals

This allows to add custom transport adapters without monkey patching.

After declaring support for custom clients and introducing HttpLocust class (#83), a subclass of Locust can either represent a new "locust" (or "user"; typical case) or new transport adapter.

For the purpose of collecting locusts, the latter should be filtered out. Currently it's detected based on the content of global list (main._internals), which requires updating for new adapters included in core (like in d5c12eabe6df08e3e7ab07adcbde181030f9ef1c for HttpLocust), or monkey patching for custom adapters.

As I'm implementing new non-HTTP adapter, I had to provide my custom client class. I thought that could serve as a better qualifier of non-locust classes, as I can't imagine an adapter without the new client type associated.