Answer the question
In order to leave comments, you need to log in
How to implement the following asynchronous construct?
Hello!
I can’t implement the following idea: We
need
a small server on sockets for a TCP connection that will control the function.
For the most part, the generator function (from an iterator) passes through an array that is too large
.
If a pause message is received on the socket, stop
. If a stop message is received on the socket, abort the passage of the link.
So far, I have come to the following idea:
The main event loop, it initially has a coroutine on handle http
When you get start, you need to launch the second coroutine and throw it into the loop so that there is competition (one coroutine is waiting for a message, the second one runs through the list)
Well, process user requests accordingly
I can run two coroutines at most (but not because a request has come)
Tell , how to implement communication between two coroutines in python, I will be very grateful
I will be very happy with a code example
Thank you in advance!
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question