crossbario / crossbario/autobahn-python

Allow use of a global clock

Open
#248 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature wamp websocket
Dominant language
Python
Stars
2.5k
Forks
768
PR merge metrics
No merged PRs in 30d

Description

Autobahn uses callLater at various places to issue calling of functions at a later time.

For efficiency reasons, users might want to use a global clock that operates at limited precision, but leads to less syscalls.

In Twisted, this can be done by (1000 Hz capped)

from twisted.internet.task import Clock, LoopingCall

clock = Clock()
LoopingCall(lambda: clock.advance(0.001)).start(0.001)

http://twistedmatrix.com/trac/browser/tags/releases/twisted-14.0.0/twisted/internet/task.py#L725

and then do clock.callLater instead of reactor.callLater.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names Autobahn's uses of callLater and the reactor.callLater API, and links to Twisted's task.py Clock and LoopingCall implementation. Start by locating the callLater entry points and their tests, then compare how a configurable global clock could be supplied. Done means users can select a lower-precision clock without breaking delayed calls.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
networking, performance
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.