Thread: Dialcentral 1.0
View Single Post
epage's Avatar
Posts: 1,684 | Thanked: 1,562 times | Joined on Jun 2008 @ Austin, TX
#899
Some stuff on The One RIng:

I have a simple test case (outside of UI) that:
* Can toggle Do Not Disturb
* Make a call
* Send a text

I am working on the state machine for polling the server for updates. My current thought is:
* You start with a POLL_TIME of INITIAL
* As long as there no no new messages, we double POLL_TIME till it hits MAX
* Every time there are new messages, we reset POLL_TIME to INITIAL
* When you are idle POLL_TIME is set to a constant IDLE

I'll give an example with
* INITIAL = 5 seconds
* MAX = 2 minutes
* IDLE = 10 minutes

A friend sends you a text, at most (when not "away") it will take 2 minutes for you to see it.

You respond and they respond back all within 30 seconds, you will see the response in 35 seconds (5s + 10s + 20s)

Now you say goodbye. The One Ring will check for new messages after 5s, 15s, 35s, 1 min 15s, 3 min 15s, 5 min 15s, 7 min 15s, etc.

So switch to being marked "away" in chat, it now checks for new texts every 10 minutes

Now you switch to Do Not Disturb. The One Ring will not poll the server at all and you will also not get any calls.

Does this sound like a reasonable compromise for battery life and low latency? Other ideas? Any suggestions for INITAL, MAX, and IDLE? Interest in configuring these through the UI? Interest in a manual mode?

An alternative approach is POLL_TIME = CONSTANT + GEOM, meaning there is a large constant time factory (5 seconds) and a small doubling factory (1 second) so this will peg the CPU but will also back off more slowly. For example we would check after 5, 11, 18, 27, 48, 1 min 25s, 3 min 25s, 5 min 25s, 7 min 25s, etc)

For those interested, the following page has all the states I'm allowed to play with
http://telepathy.freedesktop.org/spe...ePresence.html

EDIT: Fixed my geom growth from the pauses to elapsed time
__________________
770, n810, n900, Ideapad S10-3t
TheOneRing, DialCentral, Gonvert, Quicknote, Multilist, ejpi, nQa, Waters of Shiloah
Programming Blog

Last edited by epage; 2009-12-16 at 03:37.
 

The Following 2 Users Say Thank You to epage For This Useful Post: