Better handling and logging for intermittent HTTP client submission errors.
[quix0rs-apt-p2p.git] / apt_p2p / __init__.py
1
2 """The main apt-p2p modules.
3
4 To run apt-p2p, you probably want to do something like::
5
6   from apt_p2p.apt_p2p import AptP2P
7   factory = AptP2P(DHT)
8
9 where DHT is a class that implements interfaces.IDHT.
10
11 Diagram of the interaction between the given modules::
12   
13   +---------------+    +-----------------------------------+    +-------------
14   |     AptP2P    |    |               DHT                 |    |  
15   |               |--->|join                            DHT|----|--\    
16   |               |--->|loadConfig                         |    |  | Another
17   |               |--->|getValue                           |    |  | Node
18   |               |--->|storeValue                      DHT|<---|--/
19   |               |--->|leave                              |    |
20   |         /-----|--->|getStats                           |    |
21   |         |     |    +-----------------------------------+    | Internet
22   |         |     |    +-------------+    +----------------+    |
23   |         |     |    | PeerManager |    | HTTPDownloader*|    |
24   |         |     |--->|get          |--->|get         HTTP|----|---> Mirror
25   |         |     |    |             |--->|getRange        |    |
26   |         |     |--->|close        |--->|close       HTTP|----|--\       
27   |         |     |    +-------------+    +----------------+    |  | Another
28   |         |     |    +-----------------------------------+    |  | Peer
29   |         |     |    |           HTTPServer          HTTP|<---|--/   
30   |         |     |    |                                   |    +-------------
31   |       getStats|<---|                                   |    +-------------
32   |       get_resp|<---|                               HTTP|<---|HTTP Request
33   |               |    +-----------------------------------+    | 
34   |               |    +---------------+    +--------------+    | Local Net
35   |               |    | CacheManager  |    | ProxyFile-   |    | (apt)
36   |               |--->|scanDirectories|    | Stream*      |    |
37   |               |--->|save_file      |--->|__init__  HTTP|--->|HTTP Response
38   |               |--->|save_error     |    |              |    +-------------
39   |               |    |               |    |              |    +-------------
40   |new_cached_file|<---|               |    |          file|--->|write file
41   |               |    +---------------+    +--------------+    |
42   |               |    +---------------+    +--------------+    | Filesystem
43   |               |    | MirrorManager |    | AptPackages* |    |
44   |               |--->|updatedFile    |--->|file_updated  |    | 
45   |               |--->|findHash       |--->|findHash  file|<---|read file
46   +---------------+    +---------------+    +--------------+    +-------------
47
48 """