Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

A simple module for creating a background thread and returning a Future object

Project Description

Creates a thread with Future attributes.

Based on (and actively uses) features from concurrent.futures module to easily start a function in a new background thread without the overhead of using a ThreadPoolExecutor, while still providing a Future style handle around said thread.

Usage:

import time
from future_thread import Future, DeferredFuture

def background():
    time.sleep(10)
    return True

fut = Future(background)
fut.result()  # will block until thread finished


fut = DeferredFuture(background)
# do some other stuff
fut.start()

For more info on the Future object see: https://docs.python.org/3/library/concurrent.futures.html#concurrent.futures.Future

Release History

Release History

This version
History Node

1.0

Download Files

Download Files

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

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
future_thread-1.0-py2.py3-none-any.whl (3.5 kB) Copy SHA256 Checksum SHA256 py2.py3 Wheel Jun 24, 2017

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting