Re: [whatwg] Polling APIs in JavaScript vs Callbacks

2013-02-12 Thread Elliott Sprehn
On Mon, Feb 11, 2013 at 10:56 PM, Garrett Smith wrote: > On 2/9/13, Glenn Maynard wrote: > > On Sat, Feb 9, 2013 at 10:43 AM, Tab Atkins Jr. > > wrote: > > > >> That said, there *are* still some isolated use-cases for polling. ^_^ > >> When an event-based approach would potentially deliver far

Re: [whatwg] Polling APIs in JavaScript vs Callbacks

2013-02-11 Thread Garrett Smith
On 2/11/13, Garrett Smith wrote: [...] > > var listener = { > handleEvent : function(ev) { console.log(ev); }, > quant : 40 > }; > // or even > function handleEvent (ev) { console.log(ev); } > handleEvent.quant = 40; > Second example should have been function listener(ev) { console.log(

Re: [whatwg] Polling APIs in JavaScript vs Callbacks

2013-02-11 Thread Garrett Smith
On 2/9/13, Glenn Maynard wrote: > On Sat, Feb 9, 2013 at 10:43 AM, Tab Atkins Jr. > wrote: > >> That said, there *are* still some isolated use-cases for polling. ^_^ >> When an event-based approach would potentially deliver far too many >> events, with separation between them perhaps less than 1

Re: [whatwg] Polling APIs in JavaScript vs Callbacks

2013-02-11 Thread Elliott Sprehn
On Sat, Feb 9, 2013 at 8:43 AM, Tab Atkins Jr. wrote: > On Thu, Feb 7, 2013 at 6:32 PM, Glenn Maynard wrote: > > This is just to say: callbacks are the pattern on on the platform, not > > polling, and WebGL should follow that pattern, not go its own way and > make > > up its own conventions. If

Re: [whatwg] Polling APIs in JavaScript vs Callbacks

2013-02-09 Thread Glenn Maynard
On Sat, Feb 9, 2013 at 10:43 AM, Tab Atkins Jr. wrote: > That said, there *are* still some isolated use-cases for polling. ^_^ > When an event-based approach would potentially deliver far too many > events, with separation between them perhaps less than 1ms, exposing a > polling-based API instea

Re: [whatwg] Polling APIs in JavaScript vs Callbacks

2013-02-09 Thread Tab Atkins Jr.
On Thu, Feb 7, 2013 at 6:32 PM, Glenn Maynard wrote: > This is just to say: callbacks are the pattern on on the platform, not > polling, and WebGL should follow that pattern, not go its own way and make > up its own conventions. If people don't understand why the platform's > conventions are what

Re: [whatwg] Polling APIs in JavaScript vs Callbacks

2013-02-07 Thread Glenn Maynard
On Thu, Feb 7, 2013 at 6:24 PM, Gregg Tavares wrote: > Anyone have time to give me some advice, tips, pointers? > > In the next WebGL we have Query/Sync objects. In C/C++ land the user can > insert some drawing commands that will happen asynchronously on the GPU. > They can also insert a query.

[whatwg] Polling APIs in JavaScript vs Callbacks

2013-02-07 Thread Gregg Tavares
Anyone have time to give me some advice, tips, pointers? In the next WebGL we have Query/Sync objects. In C/C++ land the user can insert some drawing commands that will happen asynchronously on the GPU. They can also insert a query. They can then poll that query (did this finish?). We'd like to