Python 协程库 Curio

码农软件 · 软件分类 · 高性能网络开发库 · 2019-08-31 18:43:21

软件介绍

Curio 是 Python 第三方实现的协程库。Python 的并发编程 async/await 是一套接口,允许第三方实现,官方的实现是标准库asyncio。Curio 相比官方的 asyncio 使用起来更简单直观一些。

tcp echo server例子:

from curio import run, tcp_server

async def echo_client(client, addr):
    print('Connection from', addr)
    while True:
        data = await client.recv(100000)
        if not data:
            break
        await client.sendall(data)
    print('Connection closed')

if __name__ == '__main__':
    run(tcp_server, '', 25000, echo_client)

本文地址:https://codercto.com/soft/d/13591.html

High Performance Python

High Performance Python

Micha Gorelick、Ian Ozsvald / O'Reilly Media / 2014-9-10 / USD 39.99

If you're an experienced Python programmer, High Performance Python will guide you through the various routes of code optimization. You'll learn how to use smarter algorithms and leverage peripheral t......一起来看看 《High Performance Python》 这本书的介绍吧!

HTML 编码/解码
HTML 编码/解码

HTML 编码/解码

HEX HSV 转换工具
HEX HSV 转换工具

HEX HSV 互换工具

HSV CMYK 转换工具
HSV CMYK 转换工具

HSV CMYK互换工具