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://www.codercto.com/soft/d/13591.html

Complexity and Approximation

Complexity and Approximation

G. Ausiello、P. Crescenzi、V. Kann、Marchetti-sp、Giorgio Gambosi、Alberto M. Spaccamela / Springer / 2003-02 / USD 74.95

This book is an up-to-date documentation of the state of the art in combinatorial optimization, presenting approximate solutions of virtually all relevant classes of NP-hard optimization problems. The......一起来看看 《Complexity and Approximation》 这本书的介绍吧!

html转js在线工具
html转js在线工具

html转js在线工具

正则表达式在线测试
正则表达式在线测试

正则表达式在线测试

RGB CMYK 转换工具
RGB CMYK 转换工具

RGB CMYK 互转工具