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 '.'
        gevent.sleep(delay)

gevent.spawn(tictoc)

# 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.

Source Distribution

lets-0.0.7.tar.gz (4.7 kB view details)

Uploaded Source

File details

Details for the file lets-0.0.7.tar.gz.

File metadata

  • Download URL: lets-0.0.7.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for lets-0.0.7.tar.gz
Algorithm Hash digest
SHA256 05e585b51d0850616fcda731998b58cd1b1db6aafbe054f5d238eb4625721395
MD5 4e346d6538592560597f7adb6afc667e
BLAKE2b-256 a868eb29049197e5fcfd8cdb25b80295e51c91745099071f0fdb0345da295e1f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page