Python loop and web server (bottle) in the same script (Posting On Python-List Prohibited)

Gregory Ewing greg.ewing at canterbury.ac.nz
Fri Nov 24 07:00:24 EST 2017


Lawrence D’Oliveiro wrote:
> On Friday, November 24, 2017 at 3:27:17 AM UTC+13, zlju... at gmail.com wrote:
> 
>>Looks like I need some sort of parallelization.
> 
> This is why coroutines were added to Python. Threading is notoriously bug-prone, and is best avoided in most situations.

The OP claimed that the timing of the update task is critical,
and needs to take priority over serving web pages. Coroutines
won't be able to achieve that.

-- 
Greg



More information about the Python-list mailing list