diff options
| author | CoprDistGit <infra@openeuler.org> | 2023-05-10 10:01:04 +0000 |
|---|---|---|
| committer | CoprDistGit <infra@openeuler.org> | 2023-05-10 10:01:04 +0000 |
| commit | 43233bbee223dd4a124532d976b5d3de466a7fa3 (patch) | |
| tree | 818311dd2bbadc5a77480b437ddc5525b3d1d0ae | |
| parent | 3064b1d2796caed0a8375c31f443341b6f8b9538 (diff) | |
automatic import of python-async-task-queue
| -rw-r--r-- | .gitignore | 1 | ||||
| -rw-r--r-- | python-async-task-queue.spec | 297 | ||||
| -rw-r--r-- | sources | 1 |
3 files changed, 299 insertions, 0 deletions
@@ -0,0 +1 @@ +/async-task-queue-0.1.2.tar.gz diff --git a/python-async-task-queue.spec b/python-async-task-queue.spec new file mode 100644 index 0000000..87cc770 --- /dev/null +++ b/python-async-task-queue.spec @@ -0,0 +1,297 @@ +%global _empty_manifest_terminate_build 0 +Name: python-async-task-queue +Version: 0.1.2 +Release: 1 +Summary: In-memory FIFO queue for concurrent task execution +License: BSD-3-Clause +URL: https://github.com/NarrativeScience/async-task-queue +Source0: https://mirrors.nju.edu.cn/pypi/web/packages/f7/83/b419adb62ed208a6cf48f9c4a200e331549746b6fc4cc0831a1059aac145/async-task-queue-0.1.2.tar.gz +BuildArch: noarch + + +%description +# async-task-queue + +[](https://circleci.com/gh/NarrativeScience/async-task-queue/tree/master) [](https://pypi.org/pypi/async-task-queue/) [](https://opensource.org/licenses/BSD-3-Clause) + +In-memory FIFO queue for concurrent task execution. Used to execute tasks concurrently with optional control (via semaphore) over the max number of tasks running at the same time. + +Features: + +- Queue processing summary logging +- Introspection of failed, retried, and succeeded tasks +- Task retries (optional) +- Task execution timeout (optional) +- Queue processing with semaphore (optional) +- Batch size control (optional) + +TOC: + +- [Installation](#installation) +- [Guide](#guide) +- [Development](#development) + +## Installation + +async-task-queue requires Python 3.6 or above. + +```bash +pip install async-task-queue +``` + +## Guide + +```python +import logging +from async_task_queue import AsyncTask, AsyncTaskQueue + +# Initialize a logger +logger = logging.getLogger("foo") + +# Initialize an AsyncTaskQueue where: +# - At most 5 tasks are running concurrently +# - Number of tasks executing concurrently should be limited by a semaphore +# - Failed tasks should be retried (default behavior) +# - Executing the tasks queued should timeout and be cancelled after 5 minutes +task_queue = AsyncTaskQueue( + logger, + use_semaphore=True, + batch_size=5, + execution_timeout=300 +) + +# Add async tasks to the queue +task_queue.enqueue( + [ + AsyncTask(some_coroutine, *args, **kwargs) for args, kwargs in some_args_kwargs + ] +) + +# Start processing the queue +await task_queue.execute() +``` + +## Development + +To develop async-task-queue, install dependencies and enable the pre-commit hook: + +```bash +pip install pre-commit tox +pre-commit install +``` + +To run tests: + +```bash +tox +``` + + +%package -n python3-async-task-queue +Summary: In-memory FIFO queue for concurrent task execution +Provides: python-async-task-queue +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-async-task-queue +# async-task-queue + +[](https://circleci.com/gh/NarrativeScience/async-task-queue/tree/master) [](https://pypi.org/pypi/async-task-queue/) [](https://opensource.org/licenses/BSD-3-Clause) + +In-memory FIFO queue for concurrent task execution. Used to execute tasks concurrently with optional control (via semaphore) over the max number of tasks running at the same time. + +Features: + +- Queue processing summary logging +- Introspection of failed, retried, and succeeded tasks +- Task retries (optional) +- Task execution timeout (optional) +- Queue processing with semaphore (optional) +- Batch size control (optional) + +TOC: + +- [Installation](#installation) +- [Guide](#guide) +- [Development](#development) + +## Installation + +async-task-queue requires Python 3.6 or above. + +```bash +pip install async-task-queue +``` + +## Guide + +```python +import logging +from async_task_queue import AsyncTask, AsyncTaskQueue + +# Initialize a logger +logger = logging.getLogger("foo") + +# Initialize an AsyncTaskQueue where: +# - At most 5 tasks are running concurrently +# - Number of tasks executing concurrently should be limited by a semaphore +# - Failed tasks should be retried (default behavior) +# - Executing the tasks queued should timeout and be cancelled after 5 minutes +task_queue = AsyncTaskQueue( + logger, + use_semaphore=True, + batch_size=5, + execution_timeout=300 +) + +# Add async tasks to the queue +task_queue.enqueue( + [ + AsyncTask(some_coroutine, *args, **kwargs) for args, kwargs in some_args_kwargs + ] +) + +# Start processing the queue +await task_queue.execute() +``` + +## Development + +To develop async-task-queue, install dependencies and enable the pre-commit hook: + +```bash +pip install pre-commit tox +pre-commit install +``` + +To run tests: + +```bash +tox +``` + + +%package help +Summary: Development documents and examples for async-task-queue +Provides: python3-async-task-queue-doc +%description help +# async-task-queue + +[](https://circleci.com/gh/NarrativeScience/async-task-queue/tree/master) [](https://pypi.org/pypi/async-task-queue/) [](https://opensource.org/licenses/BSD-3-Clause) + +In-memory FIFO queue for concurrent task execution. Used to execute tasks concurrently with optional control (via semaphore) over the max number of tasks running at the same time. + +Features: + +- Queue processing summary logging +- Introspection of failed, retried, and succeeded tasks +- Task retries (optional) +- Task execution timeout (optional) +- Queue processing with semaphore (optional) +- Batch size control (optional) + +TOC: + +- [Installation](#installation) +- [Guide](#guide) +- [Development](#development) + +## Installation + +async-task-queue requires Python 3.6 or above. + +```bash +pip install async-task-queue +``` + +## Guide + +```python +import logging +from async_task_queue import AsyncTask, AsyncTaskQueue + +# Initialize a logger +logger = logging.getLogger("foo") + +# Initialize an AsyncTaskQueue where: +# - At most 5 tasks are running concurrently +# - Number of tasks executing concurrently should be limited by a semaphore +# - Failed tasks should be retried (default behavior) +# - Executing the tasks queued should timeout and be cancelled after 5 minutes +task_queue = AsyncTaskQueue( + logger, + use_semaphore=True, + batch_size=5, + execution_timeout=300 +) + +# Add async tasks to the queue +task_queue.enqueue( + [ + AsyncTask(some_coroutine, *args, **kwargs) for args, kwargs in some_args_kwargs + ] +) + +# Start processing the queue +await task_queue.execute() +``` + +## Development + +To develop async-task-queue, install dependencies and enable the pre-commit hook: + +```bash +pip install pre-commit tox +pre-commit install +``` + +To run tests: + +```bash +tox +``` + + +%prep +%autosetup -n async-task-queue-0.1.2 + +%build +%py3_build + +%install +%py3_install +install -d -m755 %{buildroot}/%{_pkgdocdir} +if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi +if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi +if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi +if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi +pushd %{buildroot} +if [ -d usr/lib ]; then + find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/lib64 ]; then + find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/bin ]; then + find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/sbin ]; then + find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst +fi +touch doclist.lst +if [ -d usr/share/man ]; then + find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst +fi +popd +mv %{buildroot}/filelist.lst . +mv %{buildroot}/doclist.lst . + +%files -n python3-async-task-queue -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Wed May 10 2023 Python_Bot <Python_Bot@openeuler.org> - 0.1.2-1 +- Package Spec generated @@ -0,0 +1 @@ +1308576d957d9f6bfcfd4c844661d369 async-task-queue-0.1.2.tar.gz |
