Giter Club home page Giter Club logo

ferris's People

Contributors

andrewjstone avatar

Stargazers

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

Watchers

 avatar  avatar  avatar

ferris's Issues

Provide a way to list existing timers

The API currently doesn't allow clients to inspect the list of timers in any way, even for debugging. Implementing fmt::Debug and/or providing a .timers() method that gives an iterator over the registered timers would be extremely handy.

Support std::time::Duration

ferris currently operates on time::Duration from the (deprecated) time crate. It would be great if it could instead use the standard Duration struct from std::time.

Provide a way to find time until *closest* timer expires

Imagine you have a set of timers, but you need to do a blocking operation (like a read system call). You'd like to set a timeout for the system call so that you can detect expired timers in a timely fashion, because the block could last for a long time. There isn't currently a way in ferris to get the time until the nearest timeout expires, which would be necessary to provide this kind of functionality. Instead, you have to set a timeout on the order of your finest resolution, which can result in lots of unnecessary wakeups.

too coarse ? ...

this needs migration of timers between inner wheels per original paper, the way it's rounding up is up to 50% error on the timer as far I see the code right now. Still looking ...

Name of `expire` is misleading

I completely misunderstood the semantics of expire. I assumed that every time I call it, it will give me any expired timers based on the current time. However, after reading the code (and re-reading the top-level documentation), this does not seem to be the case. Instead, it seems like expire is more like a tick function that must be called exactly every resolution time units, and will return any timers that expired that time unit, which is a very different interface from what I had in mind.

For me personally, this probably means that ferris isn't for me; I specifically want it to work with wall-clock time without requiring exactly regular calls to expire. That doesn't mean that ferris is bad in any way (I partially understand why the interface is this way), but I do think this fact need to be clearly stated, and be reinforced by the method names and type signatures. For example, using Duration is misleading when the methods (again, unless I've misunderstood) do not actually use wall-clock time for anything. Instead, it's more like "number of ticks", which is just a usize.

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.