fwee

lightio - 纯 ruby 实现的绿色线程

  •  
  •   fwee · Feb 10, 2018 · 3424 views
    This topic created in 3053 days ago, the information mentioned may be changed or developed.

    https://github.com/socketry/lightio

    做了几个月的开源项目,目前完成度还可以。想法来自于 gevent,给 ruby 提供绿色线程,并且可以用 monkey patch 替换所有的原生线程(类似 goroutine 这样)。

    算是给 ruby 弥补下没有 gevent 的遗憾,实现上也大量借鉴了 gevent,因为 ruby 支持 Fiber 不需要自己来实现类 coroutine 的功能,省下很多功夫。

    跑下简单的 http 测试,效率大致与 native thread 相当 https://github.com/socketry/lightio/blob/master/examples/http_requests.rb

    欢迎 star & 贡献!

    1 replies    2018-02-11 09:15:22 +08:00
    cloudyplain
        1
    cloudyplain  
       Feb 11, 2018
    虽然不用 ruby,支持下
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5554 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 56ms · UTC 07:42 · PVG 15:42 · LAX 00:42 · JFK 03:42
    ♥ Do have faith in what you're doing.