author | Matt Harbison <matt_harbison@yahoo.com> |
Wed, 20 Nov 2019 13:01:56 -0500 | |
changeset 43845 | 1ffbd03c8d75 |
parent 37626 | 0a9c0d3480b2 |
permissions | -rw-r--r-- |
37623
eb687c28a915
thirdparty: vendor futures 3.2.0
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
1 |
# Copyright 2009 Brian Quinlan. All Rights Reserved. |
eb687c28a915
thirdparty: vendor futures 3.2.0
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
2 |
# Licensed to PSF under a Contributor Agreement. |
eb687c28a915
thirdparty: vendor futures 3.2.0
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
3 |
|
eb687c28a915
thirdparty: vendor futures 3.2.0
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
4 |
"""Execute computations asynchronously using threads or processes.""" |
eb687c28a915
thirdparty: vendor futures 3.2.0
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
5 |
|
37626
0a9c0d3480b2
futures: switch to absolute and relative imports
Gregory Szorc <gregory.szorc@gmail.com>
parents:
37623
diff
changeset
|
6 |
from __future__ import absolute_import |
0a9c0d3480b2
futures: switch to absolute and relative imports
Gregory Szorc <gregory.szorc@gmail.com>
parents:
37623
diff
changeset
|
7 |
|
37623
eb687c28a915
thirdparty: vendor futures 3.2.0
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
8 |
__author__ = 'Brian Quinlan (brian@sweetapp.com)' |
eb687c28a915
thirdparty: vendor futures 3.2.0
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
9 |
|
37626
0a9c0d3480b2
futures: switch to absolute and relative imports
Gregory Szorc <gregory.szorc@gmail.com>
parents:
37623
diff
changeset
|
10 |
from ._base import ( |
0a9c0d3480b2
futures: switch to absolute and relative imports
Gregory Szorc <gregory.szorc@gmail.com>
parents:
37623
diff
changeset
|
11 |
FIRST_COMPLETED, |
0a9c0d3480b2
futures: switch to absolute and relative imports
Gregory Szorc <gregory.szorc@gmail.com>
parents:
37623
diff
changeset
|
12 |
FIRST_EXCEPTION, |
0a9c0d3480b2
futures: switch to absolute and relative imports
Gregory Szorc <gregory.szorc@gmail.com>
parents:
37623
diff
changeset
|
13 |
ALL_COMPLETED, |
0a9c0d3480b2
futures: switch to absolute and relative imports
Gregory Szorc <gregory.szorc@gmail.com>
parents:
37623
diff
changeset
|
14 |
CancelledError, |
0a9c0d3480b2
futures: switch to absolute and relative imports
Gregory Szorc <gregory.szorc@gmail.com>
parents:
37623
diff
changeset
|
15 |
TimeoutError, |
0a9c0d3480b2
futures: switch to absolute and relative imports
Gregory Szorc <gregory.szorc@gmail.com>
parents:
37623
diff
changeset
|
16 |
Future, |
0a9c0d3480b2
futures: switch to absolute and relative imports
Gregory Szorc <gregory.szorc@gmail.com>
parents:
37623
diff
changeset
|
17 |
Executor, |
0a9c0d3480b2
futures: switch to absolute and relative imports
Gregory Szorc <gregory.szorc@gmail.com>
parents:
37623
diff
changeset
|
18 |
wait, |
0a9c0d3480b2
futures: switch to absolute and relative imports
Gregory Szorc <gregory.szorc@gmail.com>
parents:
37623
diff
changeset
|
19 |
as_completed, |
0a9c0d3480b2
futures: switch to absolute and relative imports
Gregory Szorc <gregory.szorc@gmail.com>
parents:
37623
diff
changeset
|
20 |
) |
0a9c0d3480b2
futures: switch to absolute and relative imports
Gregory Szorc <gregory.szorc@gmail.com>
parents:
37623
diff
changeset
|
21 |
from .thread import ThreadPoolExecutor |
37623
eb687c28a915
thirdparty: vendor futures 3.2.0
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
22 |
|
eb687c28a915
thirdparty: vendor futures 3.2.0
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
23 |
try: |
37626
0a9c0d3480b2
futures: switch to absolute and relative imports
Gregory Szorc <gregory.szorc@gmail.com>
parents:
37623
diff
changeset
|
24 |
from .process import ProcessPoolExecutor |
37623
eb687c28a915
thirdparty: vendor futures 3.2.0
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
25 |
except ImportError: |
eb687c28a915
thirdparty: vendor futures 3.2.0
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
26 |
# some platforms don't have multiprocessing |
eb687c28a915
thirdparty: vendor futures 3.2.0
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
27 |
pass |