Skip to main content

Several greenlet subclasses

Project description

Several gevent.Greenlet subclasses.

  • Processlet
  • Transparentlet
import bcrypt
import gevent
from lets import Processlet

# bcrypt.hashpw is very heavy cpu-bound task. it can spend a few seconds.
def hash_password(password, salt=bcrypt.gensalt()):
    return bcrypt.hashpw(str(password), salt)

def tictoc(delay=0.1):
    while True:
        print '.'


# Greenlet, tictoc pauses for a few seconds
glet = gevent.spawn(hash_password, 'my_password')
hash = glet.get()

# Processlet, tictoc never pauses
proc = Processlet.spawn(hash_password, 'my_password')
hash = proc.get()

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
lets-0.0.7.tar.gz (4.7 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page