Comments (6)
其实就是 SetReadDeadline
,timing-wheel 不够精确、tick间隔越低越精确但是就可能empty loop更多,所以并不是很划算,定时器这种优先级队列场景还是 heap timer 更好些。有兴趣可用参考下我这的实现:
https://github.com/lesismal/nbio/blob/master/conn_unix.go#L223
from netpoll.
是的,这个确实没有找到很好的实现,主要是代价较大,我们再评估一下,或考虑移除它。
现在可能要自定义实现,通过 context 或者 timer。
from netpoll.
确实,踢空闲连接和 keep alive 没什么关系,踢掉空闲连接需要类似于 timer 的东西来支持,可以参考 muduo 书的 7.10 使用时间轮来踢
from netpoll.
确实,踢空闲连接和 keep alive 没什么关系,踢掉空闲连接需要类似于 timer 的东西来支持,可以参考 muduo 书的 7.10 使用时间轮来踢
Do you have an example of this implementation we can use as a workaround in the meantime?
from netpoll.
确实,踢空闲连接和 keep alive 没什么关系,踢掉空闲连接需要类似于 timer 的东西来支持,可以参考 muduo 书的 7.10 使用时间轮来踢
Do you have an example of this implementation we can use as a workaround in the meantime?
You may refer to http://www.cs.columbia.edu/~nahum/w6998/papers/ton97-timing-wheels.pdf.
And Google something like heap-based timer, timing-wheel, etc.
from netpoll.
cool
from netpoll.
Related Issues (20)
- Why `SetFinalizer` is needed when `eventLoop` exit in `Serve` func HOT 1
- netpoll源码疑问 HOT 11
- uint value overflow error on aarch64 environment HOT 2
- [Fasthttp] panic: BUG: net.Listener returned (nil, nil) HOT 3
- "no such file or directory when flush" error
- Reporting a vulnerability HOT 1
- Status of netpoll io_uring HOT 4
- netpoll 是否支持32位系统? HOT 1
- resource temporarily unavailable error HOT 3
- 如何在多个协程里读写Connecion? HOT 4
- 需要连接建立以后执行一次逻辑 HOT 2
- 客户端使用OnRequest时无法控制context初始化 HOT 2
- need reuse connection HOT 3
- Poll Manager should be initialized lazily HOT 2
- wrong comments in connection_impl.go HOT 2
- struct connection field inputBarrier *barrier never used HOT 2
- interface Connection method Accpet() should return netpoll.Conn instead of net.Conn HOT 2
- Run netpoll on Windows: a netpoll interface implement with standard go net HOT 4
- 是否可以简化 HOT 2
- exception implement net.Error HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from netpoll.