This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Help us improve Python packaging - Donate today!
Project Description

py_easy_async provides simple interface for threading to easy perform async actions in Python versions 3.4 and up

Example of simple async operations

import py_easy_async
import time

def print_with_sleep(word):
    time.sleep(1)
    print(word)
    return 'done'

print('first')
py_easy_async.async(lambda: print_with_sleep('second'),
                 lambda done_string: print("done callback called with string: %s" % done_string))
print('third')

The above example will print the following:

first
third
second
done callback called with string: done

Example of thread pool management

from py_easy_async import pool

def message_handler(message):
    print('got message:', message)

identifier = pool.run_thread(message_handler, name='Persistent-Thread')

for i in range(5):
    pool.message(identifier, "test message #%s" % i)

pool.stop_thread(identifier)

The above example will start thread that will wait for messages that it should process:

Persistent-Thread starting...

got message: test message #0
got message: test message #1
got message: test message #2
got message: test message #3
got message: test message #4

Persistent-Thread exiting...

License

Released under the MIT license.

Installation

pip install py_easy_async
Release History

Release History

0.1.2

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

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
py_easy_async-0.1.2.tar.gz (2.6 kB) Copy SHA256 Checksum SHA256 Source Mar 9, 2016

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