mirror of
https://github.com/internetarchive/warcprox.git
synced 2025-01-18 13:22:09 +01:00
ThreadPoolExecutor no longer used
it was part of the multi-threaded warc writer implementation
This commit is contained in:
parent
0882a2b174
commit
79d09d013b
@ -1,7 +1,7 @@
|
|||||||
"""
|
"""
|
||||||
warcprox/__init__.py - warcprox package main file, contains some utility code
|
warcprox/__init__.py - warcprox package main file, contains some utility code
|
||||||
|
|
||||||
Copyright (C) 2013-2018 Internet Archive
|
Copyright (C) 2013-2019 Internet Archive
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or
|
This program is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU General Public License
|
modify it under the terms of the GNU General Public License
|
||||||
@ -57,17 +57,6 @@ class Jsonner(json.JSONEncoder):
|
|||||||
else:
|
else:
|
||||||
return json.JSONEncoder.default(self, o)
|
return json.JSONEncoder.default(self, o)
|
||||||
|
|
||||||
class ThreadPoolExecutor(concurrent.futures.ThreadPoolExecutor):
|
|
||||||
'''
|
|
||||||
`concurrent.futures.ThreadPoolExecutor` supporting a queue of limited size.
|
|
||||||
|
|
||||||
If `max_queued` is set, calls to `submit()` will block if necessary until a
|
|
||||||
free slot is available.
|
|
||||||
'''
|
|
||||||
def __init__(self, max_queued=None, *args, **kwargs):
|
|
||||||
super().__init__(*args, **kwargs)
|
|
||||||
self._work_queue = queue.Queue(maxsize=max_queued or 0)
|
|
||||||
|
|
||||||
# XXX linux-specific
|
# XXX linux-specific
|
||||||
def gettid():
|
def gettid():
|
||||||
try:
|
try:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user