Coder Social home page Coder Social logo

poller's People

Contributors

npat-efault avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

poller's Issues

Close method is unsafe.

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.

syscall.EpollCreate and signal.Notify

General Question

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().

Cross-platform

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

Add implementation based on kqueue

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.