IronPort协程/线程库

coro的Python项目详细描述


这个python库是在ironport系统中开发的,并且已经提供了 在麻省理工学院的许可下,由思科系统公司开放源码。

简介

弹片是一个高性能并发库。它使用 在kqueue(freebsd, OS X)或/dev/epoll(linux),主要用Pyrex/Cython编写, 支持32位和64位平台。它是 在Ironport Systems公司工作8年,该公司是一家高速铁路供应商 邮件设备。2011年底,思科系统(cisco systems)对其进行了开源。

状态

2013年4月18日:我最近合并了几家分支机构 重要功能:

  • Support for pure-cython servers (branch ‘pxdfix’)
  • Full DNS resolver implementation (branch ‘dns-cache’)
  • Updated postgres support (branch ‘postgres’)
  • Included OpenSSL support

功能

  • Lightweight threads, event-driven scheduler.
  • Underneath: non-blocking operations on descriptors, like sockets and pipes.
  • On top, synchronous API for straight-line, simple code.
  • Highly scalable - tens or hundreds of thousands of connections/threads.
  • Thread synchronization primitives, like mutexes, semaphores, etc…
  • with_timeout(): wrap any funcall with a timeout.
  • Wait on kqueue events like file/directory changes, signals, processes, etc… [kqueue only]
  • DNS resolver and cache
  • HTTP server and client (plus WebSocket, RFC6455 & hixie-76)
  • Support for TLS via tlslite and openssl (plus NPN for both)
  • other protocols/codecs: ldap, asn1, ftp, mysql, postgres, AMQP.
  • MIT License.

优点

与其他可用于python的并发包相比, 弹片给你:

  • Speed and Efficiency: the entire scheduler, poller, socket layer, synchronization objects, etc… are written in Cython, with an emphasis on performance and low memory usage.
  • Stock Python: Shrapnel works with out-of-the-box CPython [2.X]. No special variants of Python are needed, it will even work with your OS’s OEM python installation. So you can use all the external libraries/modules you’ve come to rely on.
  • No Callbacks: no need to cuisinart your application into a thousand callbacks. No need to decompose every action into a state machine. Write simple, performant code now without having to send your programmers to class.
  • Drop to Cython for speed: all the capabilities of the system are available from Cython, so you can e.g. write a server entirely in Cython for speed. You can interface with external libraries, and do thread switches from Cython or C. It’s even possible to have external C code call back into shrapnel. This makes it easy to prototype your application in Python, and then push only the hot spots into Cython.
  • Timeouts: Shrapnel provides a general timeout mechanism that can be used to wrap any function call with a timeout.
  • Profiler: Thread-aware profiler generates HTML reports.

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
使用ApacheCXF和Eclipse的web服务中的java JNI问题   java如何在模式中正确声明扩展?   java Mapstruct从源对象的一组字段中准备一个列表,并将其设置为目标对象   Java:Infinite循环hasnetint()   面向对象Java装饰图案比萨面层   oop Java将常用方法放入超类   Java程序不断崩溃   使用扫描仪写入文本文件时出现java异常错误   java如何打印没有尾随逗号的地图?   使用java在中缀到后缀应用程序中获得错误输出   Java正则表达式拆分运算符的数学表达式,不包括括号中的运算符   java如何从KeyClope获取用户详细信息(不是登录用户,而是通过id获取任何用户)   java如何通过选择微调器启用或禁用editText   java jasypt有多安全?   java上传图像失败   java JDBC批量更新有什么帮助?   java如何在添加新视频文件时获取通知   java将值Bean传递给类,然后将类传递给JSP   java Primefaces Datatable在触发操作时提供空指针异常   Java:在可调整大小的组件中调整旋转形状的大小