Debian Codegraph @

docs/index.html

raw
1 <!DOCTYPE html>
2
3 <html>
4 <head>
5 <title>index.js</title>
6 <meta http-equiv="content-type" content="text/html; charset=UTF-8">
7 <meta name="viewport" content="width=device-width, target-densitydpi=160dpi, initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
8 <link rel="stylesheet" media="all" href="docco.css" />
9 </head>
10 <body>
11 <div id="container">
12 <div id="background"></div>
13
14 <ul id="jump_to">
15 <li>
16 <a class="large" href="javascript:void(0);">Jump To &hellip;</a>
17 <a class="small" href="javascript:void(0);">+</a>
18 <div id="jump_wrapper">
19 <div id="jump_page">
20
21
22 <a class="source" href="index.html">
23 index.js
24 </a>
25
26
27 <a class="source" href="backoff.html">
28 backoff.js
29 </a>
30
31
32 <a class="source" href="function_call.html">
33 function_call.js
34 </a>
35
36
37 <a class="source" href="exponential.html">
38 exponential.js
39 </a>
40
41
42 <a class="source" href="fibonacci.html">
43 fibonacci.js
44 </a>
45
46
47 <a class="source" href="strategy.html">
48 strategy.js
49 </a>
50
51 </div>
52 </li>
53 </ul>
54
55 <ul class="sections">
56
57 <li id="title">
58 <div class="annotation">
59 <h1>index.js</h1>
60 </div>
61 </li>
62
63
64
65 <li id="section-1">
66 <div class="annotation">
67
68 <div class="pilwrap ">
69 <a class="pilcrow" href="#section-1">&#182;</a>
70 </div>
71 <pre><code> Copyright (c) <span class="hljs-number">2012</span> Mathieu Turcotte
72 Licensed under the MIT license.
73 </code></pre>
74 </div>
75
76 <div class="content"><div class='highlight'><pre>
77 <span class="hljs-keyword">var</span> Backoff = <span class="hljs-built_in">require</span>(<span class="hljs-string">'./lib/backoff'</span>);
78 <span class="hljs-keyword">var</span> ExponentialBackoffStrategy = <span class="hljs-built_in">require</span>(<span class="hljs-string">'./lib/strategy/exponential'</span>);
79 <span class="hljs-keyword">var</span> FibonacciBackoffStrategy = <span class="hljs-built_in">require</span>(<span class="hljs-string">'./lib/strategy/fibonacci'</span>);
80 <span class="hljs-keyword">var</span> FunctionCall = <span class="hljs-built_in">require</span>(<span class="hljs-string">'./lib/function_call.js'</span>);
81
82 module.exports.Backoff = Backoff;
83 module.exports.FunctionCall = FunctionCall;
84 module.exports.FibonacciStrategy = FibonacciBackoffStrategy;
85 module.exports.ExponentialStrategy = ExponentialBackoffStrategy;</pre></div></div>
86
87 </li>
88
89
90 <li id="section-2">
91 <div class="annotation">
92
93 <div class="pilwrap ">
94 <a class="pilcrow" href="#section-2">&#182;</a>
95 </div>
96 <p>Constructs a Fibonacci backoff.</p>
97
98 </div>
99
100 <div class="content"><div class='highlight'><pre>module.exports.fibonacci = <span class="hljs-function"><span class="hljs-keyword">function</span><span class="hljs-params">(options)</span> {</span>
101 <span class="hljs-keyword">return</span> <span class="hljs-keyword">new</span> Backoff(<span class="hljs-keyword">new</span> FibonacciBackoffStrategy(options));
102 };</pre></div></div>
103
104 </li>
105
106
107 <li id="section-3">
108 <div class="annotation">
109
110 <div class="pilwrap ">
111 <a class="pilcrow" href="#section-3">&#182;</a>
112 </div>
113 <p>Constructs an exponential backoff.</p>
114
115 </div>
116
117 <div class="content"><div class='highlight'><pre>module.exports.exponential = <span class="hljs-function"><span class="hljs-keyword">function</span><span class="hljs-params">(options)</span> {</span>
118 <span class="hljs-keyword">return</span> <span class="hljs-keyword">new</span> Backoff(<span class="hljs-keyword">new</span> ExponentialBackoffStrategy(options));
119 };</pre></div></div>
120
121 </li>
122
123
124 <li id="section-4">
125 <div class="annotation">
126
127 <div class="pilwrap ">
128 <a class="pilcrow" href="#section-4">&#182;</a>
129 </div>
130 <p>Constructs a FunctionCall for the given function and arguments.</p>
131
132 </div>
133
134 <div class="content"><div class='highlight'><pre>module.exports.call = <span class="hljs-function"><span class="hljs-keyword">function</span><span class="hljs-params">(fn, vargs, callback)</span> {</span>
135 <span class="hljs-keyword">var</span> args = <span class="hljs-built_in">Array</span>.prototype.slice.call(<span class="hljs-built_in">arguments</span>);
136 fn = args[<span class="hljs-number">0</span>];
137 vargs = args.slice(<span class="hljs-number">1</span>, args.length - <span class="hljs-number">1</span>);
138 callback = args[args.length - <span class="hljs-number">1</span>];
139 <span class="hljs-keyword">return</span> <span class="hljs-keyword">new</span> FunctionCall(fn, vargs, callback);
140 };</pre></div></div>
141
142 </li>
143
144 </ul>
145 </div>
146 </body>
147 </html>