Last change
on this file since 256 was
256,
checked in by hendrikvanantwerpen, 13 years ago
|
Reworked project structure based on REST interaction and Dojo library. As
soon as this is stable, the old jQueryUI branch can be removed (it's
kept for reference).
|
File size:
293 bytes
|
Line | |
---|
1 | define([], function(){ |
---|
2 | var |
---|
3 | count= 0, |
---|
4 | max= 10, |
---|
5 | queue= []; |
---|
6 | return { |
---|
7 | release: function(){ |
---|
8 | if(queue.length){ |
---|
9 | (queue.shift())(); |
---|
10 | }else{ |
---|
11 | count--; |
---|
12 | } |
---|
13 | }, |
---|
14 | enqueue: function(proc){ |
---|
15 | if(count<max){ |
---|
16 | count++; |
---|
17 | proc(); |
---|
18 | }else{ |
---|
19 | queue.push(proc); |
---|
20 | } |
---|
21 | } |
---|
22 | }; |
---|
23 | }); |
---|
Note: See
TracBrowser
for help on using the repository browser.