]> git.mxchange.org Git - quix0rs-apt-p2p.git/blobdiff - apt_dht/policies.py
Only use the ThrottlingProtocol if the producer is streaming.
[quix0rs-apt-p2p.git] / apt_dht / policies.py
index 8254c9cbf2d2b6ab23d41873ebe50a06bcef23ea..3c84c149b3c38dd1317b46031fddf0b602da6e33 100644 (file)
@@ -159,6 +159,7 @@ class ThrottlingProtocol(ProtocolWrapper):
         ProtocolWrapper.dataReceived(self, data)
 
     def registerProducer(self, producer, streaming):
+        assert streaming, "You can only use the ThrottlingProtocol with streaming (push) producers."
         self.producer = producer
         ProtocolWrapper.registerProducer(self, producer, streaming)