1
2
3
4
5
6
7
9
10 - def __init__(self, keepalive=2, timeout=300):
11 """ abstract class from which all connection
12 pool should inherit.
13 """
14 if type(timeout) != type(1):
15 raise ValueError("Pool timeout isn't an integer")
16 self.keepalive = keepalive
17 self.timeout = timeout
18
19 - def get(self, netloc):
20 """ method used to return a connection from the pool"""
21 raise NotImplementedError
22
23 - def put(self, netloc, conn):
24 """ Put an item back into the pool, when done """
25 raise NotImplementedError
26
28 """ method to clear all connections from host """
29 raise NotImplementedError
30
32 """ method used to release all connections """
33 raise NotImplementedError
34