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!

Sugar for Tornado Asynchrous HTTP client

Project Description
Gale
=========
Gale is just Tornado

Installation
---------
$ pip install gale

Asynchrous HTTP Request
----------

###Get
import gale
def handle(response):
print response.body
gale.stop()

gale.get('http://httpbin.org/ip', callback=handle)
gale.start()
###Post
gale.post('http://httpbin.org/post', data={'a':1}, callback=handle)
gale.start()
###Proxy and Cookies
gale.get('http://httpbin.org/get',
params={'a':1, 'b':2},
proxy='user:pass@8.8.8.8:80',
cookies={'token': 'asdfgh'}, callback=handle)
gale.start()
###Sleep
def do_after_3_seconds():
print 'hello'
gale.stop()
gale.sleep(3, callback=do_after_3_second)
gale.start()

Task
----------
def all_done():
print 'all requests complete!'
gale.stop()

task = gale.Task()
task.add(gale.get, 'http://httpbin.org/ip', callback=handle)
task.add(gale.get, 'http://httpbin.org/get', callback=handle)
task.add(gale.post, 'http://httpbin.org/post', data={'a': 1},
callback=handle)
#or you can patch the gale.get function
#get = task.patch(gale.get)
#get('http://httpbin.org/ip', callback=handle)
#get('http://httpbin.org/get', callback=handle)
#get('http://httpbin.org/post', data={'a': 1},
# callback=handle)

task.run(all_done)
gale.start()
Release History

Release History

This version
History Node

0.0.9

History Node

0.0.8

History Node

0.0.7

History Node

0.0.6

History Node

0.0.5

History Node

0.0.4

History Node

0.0.3

History Node

0.0.2

History Node

0.0.1

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