npat-efault / poller Goto Github PK
View Code? Open in Web Editor NEWAn epoll(7)-based file-descriptor multiplexer.
License: BSD 2-Clause "Simplified" License
An epoll(7)-based file-descriptor multiplexer.
License: BSD 2-Clause "Simplified" License
github.com/npat-efault/poller/poller_select.go:29: undefined: fdSet
If Close method is called more than one time then the second call could close an invalid or in use file descriptor.
I think this method must check fd.closed flag:
func (fd *FD) Close() error {
// Take both locks, to exclude read and write operations from
// accessing a closed sysfd.
if err := fd.Lock(); err != nil {
debugf("FD %03d: CL: Closed", fd.id)
return err
}
defer fd.Unlock()
+ if fd.closed {
+ return ErrClosed
+ }
fd.closed = true
...
Thanks.
Is this package production ready?
Thanks.
Have you tried using this package along with catching an os.Interrupt signal? poller.EpollWait() will not return when signal.Notify(<>, os.Interrupt) is used. In C, one can create a pair of pipes and add them to epoll_wait(), but go syscall.EpollCtrl() errors with a bad file descriptor for os.Files from os.Pipe(). So this method cannot be used to break out of EpollWait().
If i'm not mistaken, this wont work in bsds/osx, as they dont have Epoll. would be amazing to make poller
a cross-platform solution
For BSD-derived systems that support it, a kqueue(2) based implementation would provide performance similar to the Linux epoll(7)-based one, without the limitations of select(2). It will also be very similar (trivial modifications) to the epoll(7)-based impl. Add one.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.