Show More
@@ -3,9 +3,12 b'' | |||||
3 |
|
3 | |||
4 | """Execute computations asynchronously using threads or processes.""" |
|
4 | """Execute computations asynchronously using threads or processes.""" | |
5 |
|
5 | |||
|
6 | from __future__ import absolute_import | |||
|
7 | ||||
6 | __author__ = 'Brian Quinlan (brian@sweetapp.com)' |
|
8 | __author__ = 'Brian Quinlan (brian@sweetapp.com)' | |
7 |
|
9 | |||
8 | from concurrent.futures._base import (FIRST_COMPLETED, |
|
10 | from ._base import ( | |
|
11 | FIRST_COMPLETED, | |||
9 | FIRST_EXCEPTION, |
|
12 | FIRST_EXCEPTION, | |
10 | ALL_COMPLETED, |
|
13 | ALL_COMPLETED, | |
11 | CancelledError, |
|
14 | CancelledError, | |
@@ -13,11 +16,12 b' from concurrent.futures._base import (FI' | |||||
13 | Future, |
|
16 | Future, | |
14 | Executor, |
|
17 | Executor, | |
15 | wait, |
|
18 | wait, | |
16 | as_completed) |
|
19 | as_completed, | |
17 | from concurrent.futures.thread import ThreadPoolExecutor |
|
20 | ) | |
|
21 | from .thread import ThreadPoolExecutor | |||
18 |
|
22 | |||
19 | try: |
|
23 | try: | |
20 |
from |
|
24 | from .process import ProcessPoolExecutor | |
21 | except ImportError: |
|
25 | except ImportError: | |
22 | # some platforms don't have multiprocessing |
|
26 | # some platforms don't have multiprocessing | |
23 | pass |
|
27 | pass |
@@ -1,6 +1,8 b'' | |||||
1 | # Copyright 2009 Brian Quinlan. All Rights Reserved. |
|
1 | # Copyright 2009 Brian Quinlan. All Rights Reserved. | |
2 | # Licensed to PSF under a Contributor Agreement. |
|
2 | # Licensed to PSF under a Contributor Agreement. | |
3 |
|
3 | |||
|
4 | from __future__ import absolute_import | |||
|
5 | ||||
4 | import collections |
|
6 | import collections | |
5 | import logging |
|
7 | import logging | |
6 | import threading |
|
8 | import threading |
@@ -43,8 +43,10 b' Process #1..n:' | |||||
43 | _ResultItems in "Request Q" |
|
43 | _ResultItems in "Request Q" | |
44 | """ |
|
44 | """ | |
45 |
|
45 | |||
|
46 | from __future__ import absolute_import | |||
|
47 | ||||
46 | import atexit |
|
48 | import atexit | |
47 |
from |
|
49 | from . import _base | |
48 | import Queue as queue |
|
50 | import Queue as queue | |
49 | import multiprocessing |
|
51 | import multiprocessing | |
50 | import threading |
|
52 | import threading |
@@ -3,8 +3,10 b'' | |||||
3 |
|
3 | |||
4 | """Implements ThreadPoolExecutor.""" |
|
4 | """Implements ThreadPoolExecutor.""" | |
5 |
|
5 | |||
|
6 | from __future__ import absolute_import | |||
|
7 | ||||
6 | import atexit |
|
8 | import atexit | |
7 |
from |
|
9 | from . import _base | |
8 | import itertools |
|
10 | import itertools | |
9 | import Queue as queue |
|
11 | import Queue as queue | |
10 | import threading |
|
12 | import threading |
General Comments 0
You need to be logged in to leave comments.
Login now