[Twisted-Python] Announcing Crochet 0.7: Easily use Twisted from threaded applications
Itamar Turner-Trauring
itamar at futurefoundries.com
Fri May 24 07:51:23 MDT 2013
Crochet is an MIT-licensed library that makes it easier for threaded
applications like Flask or Django to use the Twisted networking framework.
Features include:
- Runs Twisted's reactor in a thread it manages.
- Hooks up Twisted's log system to the Python standard library
loggingframework. Unlike Twisted's built-in
logging bridge, this includes support for blocking Handler instances.
- Provides a blocking API to eventual results (i.e. Deferred instances).
This release includes better documentation and API improvements, as well as
better error reporting.
Here is a simple example of using Crochet:
import sys
from twisted.web.client import getPagefrom crochet import setup,
run_in_reactorcrochet.setup()
@run_in_reactordef download_page(url):
return getPage(url)
result = download_page(sys.argv[1])# wait() returns the result when it
becomes available:print result.wait()
You can see more examples, read the documentation, and download the package
at:
https://pypi.python.org/pypi/crochet
--
Itamar Turner-Trauring, Future Foundries LLC
http://futurefoundries.com/ — Twisted consulting, training and support.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://twistedmatrix.com/pipermail/twisted-python/attachments/20130524/8f0ca38c/attachment.htm
More information about the Twisted-Python
mailing list