GitLab's annual major release is around the corner. Along with a lot of new and exciting features, there will be a few breaking changes. Learn more here.

Commit a7a2d302 authored by Nathan Graule's avatar Nathan Graule 💻
Browse files

Replace Markdown file with RST file (for pypi)

parent 2b6df78e
include README.rst
\ No newline at end of file
# Call
Thread-based, JS-like asynchronous calls for Python. Works in both Python 2.7 and Python 3.5+.
## Install
You will be soon able to install through pypi.
git clone
cd call
# Activate virtualenv if needed
python install
The library requires no other dependencies, and (will soon) support Python's `await` keyword.
## Use
Create a call:
def cb(resolve, reject):
result = factorial(100)
call = Call(cb)
Chain calls with the `then` keyword
call = Call(cb).then(lambda val: print(val))
Catch errors:
call = Call(cb)\
.then(lambda val: raise Exception())\
.catch(lambda err: print('Whoops'))
Compose calls:
results = Call.all([Call(cb) for _ in range(10)])
Block thread until resolved (or raises on failure):
result = call.wait()
Wait for call to either resolve or reject
result = # Not recommended
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment