Skip to content
Advertisement

Tag: asynchronous

If I use a helping function for a discord.py command, should I use await to call my helping function or just transfer control to my async helper

I have a command that works to send multiple type of messages that follow the same structure but I am using a helping function to send the message. For simplicity, my code looks similar to this: Option 1: Option 2 is making every function async and calling helper with await. It is my first time creating a discord bot and

Can’t understand how D. Beazley monitor future in its code on concurrence

Trying to understand concurrency based on generators, I try to follow the talk by D. Beazley. I don’t understand the purpose of future_monitor and was wondering what are the consequence of taking the function out? Here is its implementation of asynchronous server and, right after, my implementation without the future_monitor function. Perhaps I misunderstand how future and add_done_callback act with

Use the same websocket connection in multiple asynchronous loops (Python)

I am running two loops asynchronously, and want both to have access to the same websocket connection. One function periodic_fetch() fetches some data periodically (every 60 seconds) and sends a message to the websocket if a condition is met. The other retrieve_websocket() receives messages from the websocket and perform some action if a condition is met. As of now, I

How to run Airflow tasks synchronously

I have an airflow comprising of 2-3 steps PythonOperator –> It runs the query on AWS Athena and stores the generated file on specific s3 path BashOperator –> Increments the airflow variable for tracking BashOperator –> It takes the output(response) of task1 and and run some code on top of it. What happens here is the airflow gets completed within

Plotting the pool map for multi processing Python

How can I run multiple processes pool where I process run1-3 asynchronously, with a multi processing tool in python. I am trying to pass the values (10,2,4),(55,6,8),(9,8,7) for run1,run2,run3 respectively? Answer You just need to use method starmap instead of map, which, according to the documentation: Like map() except that the elements of the iterable are expected to be iterables

Advertisement