Questions tagged [greenlets]

greenlet is a Python C-extension that adds lightweight coroutines to the language, useful for cooperative multitasking.

greenlet is a Python C-extension that adds lightweight coroutines to the language, useful for cooperative multitasking.

150 questions
2
votes
0 answers

Running locust in docker produces OSError: [Errno 97] Address family not supported by protocol

I am running locust in Docker (version 23.0.3). I keep getting the following error: [2023-04-08 02:12:15,725] 044913c8d54a/INFO/locust.main: Starting web interface at http://0.0.0.0:8089 (accepting connections from all network…
Vivek Raut
  • 21
  • 1
2
votes
0 answers

Legacy install failure - error while installing greenlet on python 3.9.10

I'm trying to install sqlalchemy, which requires the package greenlet to be installed. Can someone tell me what is producing the error? I'm using Pycharm with venv environment, I have tried installing it with --force command but it gives the same…
2
votes
1 answer

Docker build crashing due to python greenlet package

I'm trying to create a Docker container from an existing Dockerfile but it's failing due to greenlet package. This container was built previously (1-2 years ago) and is working fine on a remote server, but when I try to build again locally or…
2
votes
1 answer

ERROR: gevent 1.4.0 has requirement greenlet>=0.4.14, but you'll have greenlet 0.4.13 which is incompatible

I am using Windows 10, I install Odoo from source code (https://github.com/odoo/odoo/tree/aa0554d224337e1d966479a351a3ed059d297765 ). Python version Python 3.8.0 (tags/v3.8.0:fa919fd, Oct 14 2019, 19:21:23) [MSC v.1916 32 bit (Intel)] on win32 Type…
Vy Do
  • 46,709
  • 59
  • 215
  • 313
2
votes
0 answers

how to be notified when a greenlet is scheduled to run and when it yields

Is there a way (even a hack) with which I can be notified when a eventloop (gevent) selects a greenlet to run. I want to be able to profile the time taken by my greenlets, each time they run and yield. I can call a callback from within my method,…
Akilesh
  • 1,252
  • 1
  • 9
  • 16
2
votes
1 answer

Sharing a nested object between Python processes with write access for tasklets(coroutines)?

How can I share a nested object between Python processes with write access for tasklets(coroutines)? Here is a simplified example with an analogy just I wrote for asking this question properly; First of all please install greenlet package with: sudo…
mertyildiran
  • 6,477
  • 5
  • 32
  • 55
2
votes
0 answers

Kill a Python Greenlet by id

Greenlet.spawn creates a new instance of Greenlet as defined in docs. I have this below code in which I want to be able to kill a Greenlet by its id. import gevent from gevent import Greenlet from gevent import getcurrent class BidTask(Greenlet): …
drecute
  • 748
  • 4
  • 11
  • 29
2
votes
1 answer

Gevent task with endless loop seems to block every other task aswell

I'm quite new to Gevent/Greenlet and have gone through the tutorials. I would like to run a bot for each registered team. for bot in self.bots: events.append(gevent.spawn(bot.start)) gevent.joinall(events) The interesting part is that if I…
Houman
  • 64,245
  • 87
  • 278
  • 460
2
votes
0 answers

Are coroutines in Python libraries always single-threaded?

From the gevent docs: The greenlets all run in the same OS thread and are scheduled cooperatively. From asyncio docs: This module provides infrastructure for writing single-threaded concurrent code using coroutines. asyncio does provide Try as…
Akshat Mahajan
  • 9,543
  • 4
  • 35
  • 44
2
votes
1 answer

Is it possible to sleep without yielding?

I want to send two asynchronous requests using grequests.send with a short but exact delay (say 20 ms) between them. I only want to handle the responses after both requests have been sent. Putting a time.sleep between the two sends doesn't work…
akxlr
  • 1,142
  • 9
  • 23
2
votes
1 answer

Does gevent has a basic http handler?

I am trying to build a basic web server using gevent.server, and curious to know is there any baseHTTPHandlers, I can use.
Arun
  • 59
  • 7
2
votes
1 answer

How monkey_patch(time=True) affects eventlet.spawn?

Normally, when using greenthread, I can write code as: def myfun(): print "in my func" eventlet.spawn(myfunc) eventlet.sleep(0) #then myfunc() is triggered as a thread. But after use money_patch(time=true), I can change the code…
DarkMagic
  • 213
  • 1
  • 2
  • 6
2
votes
1 answer

Gevent wait for jobs to finish (joinall vs wait)

The first documentation's example waits for all spawned jobs to finish with: gevent.joinall(jobs, timeout=2) However, joinall is not documented but wait method is: Wait for objects to become ready or for event loop to finish. Do both methods have…
laffuste
  • 16,287
  • 8
  • 84
  • 91
2
votes
2 answers

Access flask application context from within greenlet

I have a flask-script command that spawns a long sequence of greenlets. The problem is, these greenlets are unable to access my app context. I get a "> failed with RuntimeError" at all times (accessing app.logger, per example). Suggestions? On of…
Italo Maia
  • 1,956
  • 3
  • 18
  • 31
2
votes
1 answer

How does greenthread get scheduled?

In my Python program, I use eventlet to create a lot of greenthreads, just want to know if the current greenthread sleeps, which one of the rest will get scheduled and run? Any scheduler in the eventlet? Thanks!
Eric
  • 688
  • 1
  • 6
  • 17