- 授权协议: Apache
- 开发语言: Python
- 操作系统: 跨平台
- 软件首页: https://github.com/rgalanakis/goless
- 软件文档: https://goless.readthedocs.org/
软件介绍
使用 goless 库,你可以用 Python 语言编写 Go 语言风格的并发程序。goless 提供了 channels、select 和 gooutines 的函数,允许你使用 Go 语言漂亮和优雅的并发编程模型,但是以你习惯的 Python 方式。goless 基于 gevent、PyPy 或者 Stackless Python 构建,可用于 PyPy、CPython 和 Stackless Python 解释器,支持 Python 2.6 到 3.4
示例代码:
"""
A really simple example to use when demonstrating goless.
"""
from __future__ import print_function
import goless
def simple():
channel = goless.chan()
def goroutine():
while True:
value = channel.recv()
channel.send(value ** 2)
goless.go(goroutine)
for i in range(2, 5):
channel.send(i)
squared = channel.recv()
print('%s squared is %s' % (i, squared))
# Output:
# 2 squared is 4
# 3 squared is 9
# 4 squared is 16
if __name__ == '__main__':
simple()
深入浅出React和Redux
程墨 / 机械工业出版社 / 2017-4-28 / 69
本书作者是资深开发人员,有过多年的开发经验,总结了自己使用React和Redux的实战经验,系统分析React和Redux结合的优势,与开发技巧,为开发大型系统提供参考。主要内容包括:React的基础知识、如何设计易于维护的React组件、如何使用Redux控制数据流、React和Redux的相结合的方式、同构的React和Redux架构、React和Redux的性能优化、组件的测试等。一起来看看 《深入浅出React和Redux》 这本书的介绍吧!
