Re: [Task Scheduler] scheduling flexibility

Skipping the user notification variant for now seems reasonable - it would
probably be best to integrate that into a v2 Web Notifications API.

However I'm worried about highPrecision serving as a hint. If your app
needs highPrecision, it's often essential that the timer happens at that
exact moment, and inexact scheduling often wouldn't be useful. Hence I'd
rather have add(...) throw an error if you request highPrecision and it
gets denied (the app can of course catch this and add a non-highPrecision
alarm if that would be good enough). This should be easy, since add already
returns a Promise that can fail with QuotaExceededError or UnknownError; we
just need to add a new HighPrecisionDeniedError.

As for adding a boolean, perhaps it would be clearer to have "addExact" and
"addInexact"?


On Tue, Nov 12, 2013 at 8:50 AM, Michael van Ouwerkerk <
mvanouwerkerk@chromium.org> wrote:

> I like Christophe's API proposal. I recognize that the variant with user
> notification has some unresolved dependencies and might be difficult to
> adopt right now. Web Notifications has some open issues and does not have
> full browser support yet, especially not on mobile. So that would not be a
> trivial dependency to add.
>
> Regards,
>
> Michael
>
>
> On Tue, Nov 12, 2013 at 2:43 AM, Kenneth Rohde Christiansen <
> kenneth.christiansen@gmail.com> wrote:
>
>> +1
>> On Nov 12, 2013 12:34 AM, "Christophe Dumez" <ch.dumez@sta.samsung.com>
>> wrote:
>>
>>>  Hi,
>>>
>>> My proposal would be to add a 'highPrecision' boolean to the Alarm
>>> interface that the client app could set to true (false being the default)
>>> when scheduling the alarm to indicate that precise task scheduling would be
>>> preferred.
>>> I also think this flag should merely serve as a hint that the system is
>>> free to ignore (e.g. to preserve battery life, avoid spamming, ...).
>>>
>>> I am hoping this is an acceptable compromise. I am trying to be
>>> conservative here as I would prefer to avoid major API refactoring at this
>>> point, unless we really need to.
>>>
>>> Kr,
>>>
>>> On 11/05/2013 08:36 AM, Michael van Ouwerkerk wrote:
>>>
>>> How do people feel about allowing for scheduling flexibility in the Task
>>> Scheduler API? The goal of this feature would be to save battery power. If
>>> the system has flexibility about when to precisely run a task, it could
>>> batch multiple tasks together, or only run tasks when the device is awake.
>>> This way, we could avoid waking up devices too frequently.
>>>
>>>  Some use cases require precise scheduling e.g. an alarm in the
>>> morning, or a cooking timer. But there are many tasks that are much less
>>> time sensitive, these could be scheduled flexibly e.g. syncing a news feed
>>> or auto-updating to a new version.
>>>
>>>  Any comments? My apologies if this issue has been discussed previously.
>>>
>>>  Regards,
>>>
>>>  Michael van Ouwerkerk
>>>
>>>
>>> --
>>> Christophe Dumez - Samsung Telecommunications America
>>>
>>>
>

Received on Tuesday, 12 November 2013 12:09:18 UTC