[sr-dev] [kamailio/kamailio] async: added support for millisecond resolution sleep (#2016)

Paweł Pierścionek notifications at github.com
Sat Jul 27 23:24:06 CEST 2019


#### Type Of Change
- [X] New feature (non-breaking change which adds new functionality)

#### Checklist:
- [ ] PR should be backported to stable branches
- [X] Tested changes locally

#### Description
- new ms_timer parameter to enable millisecond precision timer
- new async_ms_route and async_ms_sleep functions with milliseconds as a param
- implementation:
  Each async_ms_sleep adds an entry to a linked list sorted by expiry time.
  List is checked every ms_timer ms for expired entries.
  All expired entries are pushed for execution on a pool of async workers.

This allows easy implementation of request traffic shaping with an external leaky bucket microservice
Assuring a maximum rate with no dropped requests by introducing delay. 

You can view, comment on, or merge this pull request online at:

  https://github.com/kamailio/kamailio/pull/2016

-- Commit Summary --

  * async: added support for millisecond resolution sleep

-- File Changes --

    M src/modules/async/async_mod.c (134)
    M src/modules/async/async_sleep.c (210)
    M src/modules/async/async_sleep.h (8)
    M src/modules/async/doc/async_admin.xml (113)

-- Patch Links --

https://github.com/kamailio/kamailio/pull/2016.patch
https://github.com/kamailio/kamailio/pull/2016.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/2016
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-dev/attachments/20190727/5df4f1f4/attachment.html>


More information about the sr-dev mailing list