task

Playful cat and keyboard

Playful cat and keyboard Question: Problem: The keyboard on the screen of the mobile application consists of: 26 capital Latin letters, 10 digits 4 navigation keys: up, down, right and left. The application is open on a tablet, on which an unpredictable and consistent cat walks. The unpredictability of the cat is that all its …

Total answers: 1

Pause all asyncio tasks in Python

Pause all asyncio tasks in Python Question: I have some asyncio tasks and I need to pause all of them. This is my part of code: import asyncio import random async def workers1(): while True: k = random.randint(100, 200) await asyncio.sleep(k) await my_print(k) async def workers2(): while True: k = random.randint(100, 200) await asyncio.sleep(k) await …

Total answers: 2

How to make specific background task in Django?

How to make specific background task in Django? Question: I have a mission to make a background task in Django, I tried with celery but I didn’t have success. What I have to do? I need after the person wrote the number in input and pressed submit button, for example 100, the 1% of it …

Total answers: 1

How can i fix Task was destroyed but it is pending?

How can i fix Task was destroyed but it is pending? Question: I have a problem. So I have a task that runs every time when a user writes a chat message on my discord server – it’s called on_message. So my bot has many things to do in this event, and I often get …

Total answers: 4

asyncio create task and aiohttp , 'no running event loop'

asyncio create task and aiohttp , 'no running event loop' Question: Im trying to make a Pyqt5 app with aiohttp request, and asyncio tasks. Im using quamash package too and it requires Python 3.7 so i installed this version.(it didn’t work on Python 3.10) The main reason i use asyncio and quamash is because i …

Total answers: 3

Python – What is queue.task_done() used for?

Python – What is queue.task_done() used for? Question: I wrote a script that has multiple threads (created with threading.Thread) fetching URLs from a Queue using queue.get_nowait(), and then processing the HTML. I am new to multi-threaded programming, and am having trouble understanding the purpose of the queue.task_done() function. When the Queue is empty, it automatically …

Total answers: 4

How to properly create and run concurrent tasks using python's asyncio module?

How to properly create and run concurrent tasks using python's asyncio module? Question: I am trying to properly understand and implement two concurrently running Task objects using Python 3’s relatively new asyncio module. In a nutshell, asyncio seems designed to handle asynchronous processes and concurrent Task execution over an event loop. It promotes the use …

Total answers: 3

how to get the queue in which a task was run – celery

how to get the queue in which a task was run – celery Question: I’m new using celery and have a question. I have this simple task: @app.task(name=’test_install_queue’) def test_install_queue(): return subprocess.call(“exit 0″,shell=True) and I am calling this task later in a test case like result = tasks.test_default_queue.apply_async(queue=”install”) The task run successfully in the queue …

Total answers: 3

Celery: How to ignore task result in chord or chain?

Celery: How to ignore task result in chord or chain? Question: I’m using celery, I have several tasks which needed to be executed in order. For example I have this task: @celery.task def tprint(word): print word And I want to do something like this: >>> chain(tprint.s(‘a’) | tprint.s(‘b’))() Then I get TypeError: tprint() takes exactly …

Total answers: 4

Find out whether celery task exists

Find out whether celery task exists Question: Is it possible to find out whether a task with a certain task id exists? When I try to get the status, I will always get pending. >>> AsyncResult(‘…’).status ‘PENDING’ I want to know whether a given task id is a real celery task id and not a …

Total answers: 7