chemhack
V2EX  ›  问与答

libuv如何得知写缓存满了

  •  
  •   chemhack · Aug 10, 2013 · 4094 views
    This topic created in 4679 days ago, the information mentioned may be changed or developed.
    刚从nodejs转到libuv,nodejs的stream可以通过write返回true/false来判断是否写缓存满了,然后通过pause/resume事件来做back pressure。

    看了libuv的文档和源代码,uv_write没有这种功能,那么是否有别的方法来得知写缓存已满呢?
    2 replies    1970-01-01 08:00:00 +08:00
    chemhack
        1
    chemhack  
    OP
       Aug 10, 2013
    顶顶,有木有用过的
    timonwong
        2
    timonwong  
       Aug 10, 2013
    nodejs的stream的写缓存是自己维护的。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1270 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 17:22 · PVG 01:22 · LAX 10:22 · JFK 13:22
    ♥ Do have faith in what you're doing.