mailru / easygo

Tools for building go apps.
MIT License
673 stars 123 forks source link

Poller does not implement Close method #10

Open wI2L opened 5 years ago

wI2L commented 5 years ago

The OS independent type Poller does not implement the Close method that can be found in type Epoll and Kqueue (although) it isn't implemented for the last.

I am writing a Websocket tracker using gobwas/ws and this package, and I want to implement a graceful shutdown to my server. As of now, I am calling poller.Stop on all Desc then closing connections, but it represents alot of syscalls, being able to call Close once would be easier and cleaner to stop the background loop.

Also, could you please consider implementing Close for the Kqueue implementation ?

Thanks

@gobwas

akosyakov commented 1 year ago

Is not it also leaks fd for epoll itself? even if you close all descs fd created by fd, err := unix.EpollCreate1(0) remains?