Git Product home page Git Product logo

timer's Introduction

Versioning

This project follows the semantic versioning scheme. The API change and backwards compatibility rules are those indicated by SemVer.

是什么

C++ 定时器, 基于 C++11, libuv 实现.

TimerManagerStart() 时会创建 thread_num 个工作线程, 每一个工作线程中都运行着一个 uv loop.

当通过 TimerManager::StartTimer() 提交一个定时器时, 会通过 round-robin 算法选择一个工作线程(下称 P), 然 后将定时器请求交给 P. P 在收到定时器请求之后会根据请求细节创建一个 uv_timer_t 对象来实现定时机制.

怎么用

test/main.cc 中有一个很简短的例子, 可以参考. 关于接口具体的语义可以参考每一个接口的注释.

依赖

  1. C++11
  2. libuv, v1.9.1
  3. common, v1.1.0

timer's People

Contributors

wangxiaowei0303 avatar

Watchers

ccf19881030.github.io avatar  avatar

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.