5 <title>JSDoc: Class: Poll
</title>
7 <script src=
"scripts/prettify/prettify.js"> </script>
8 <script src=
"scripts/prettify/lang-css.js"> </script>
10 <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
12 <link type=
"text/css" rel=
"stylesheet" href=
"styles/prettify-tomorrow.css">
13 <link type=
"text/css" rel=
"stylesheet" href=
"styles/jsdoc-default.css">
20 <h1 class=
"page-title">Class: Poll
</h1>
31 <h2><span class=
"attribs"><span class=
"type-signature"></span></span>
32 <span class=
"ancestors"><a href=
"LuCI.html">LuCI
</a>.
</span>Poll
</h2>
34 <div class=
"class-description"><p>The
<code>Poll
</code> class allows registering and unregistering poll actions,
35 as well as starting, stopping and querying the state of the polling
42 <div class=
"container-overview">
87 <dt class=
"tag-source">Source:
</dt>
88 <dd class=
"tag-source"><ul class=
"dummy"><li>
89 <a href=
"luci.js.html">luci.js
</a>,
<a href=
"luci.js.html#line999">line
999</a>
137 <h3 class=
"subsection-title">Methods
</h3>
145 <h4 class=
"name" id=
"active"><span class=
"type-signature"></span>active
<span class=
"signature">()
</span><span class=
"type-signature"> → {boolean}
</span></h4>
152 <div class=
"description">
153 <p>Test whether the polling loop is running.
</p>
195 <dt class=
"tag-source">Source:
</dt>
196 <dd class=
"tag-source"><ul class=
"dummy"><li>
197 <a href=
"luci.js.html">luci.js
</a>,
<a href=
"luci.js.html#line1150">line
1150</a>
225 <div class=
"param-desc">
227 <li>Returns
<code>true
</code> if polling is active, else
<code>false
</code>.
</li>
239 <span class=
"param-type">boolean
</span>
257 <h4 class=
"name" id=
"add"><span class=
"type-signature"></span>add
<span class=
"signature">(fn, interval)
</span><span class=
"type-signature"> → {boolean}
</span></h4>
264 <div class=
"description">
265 <p>Add a new operation to the polling loop. If the polling loop is not
266 already started at this point, it will be implicitely started.
</p>
280 <table class=
"params">
293 <th class=
"last">Description
</th>
302 <td class=
"name"><code>fn
</code></td>
308 <span class=
"param-type">function
</span>
318 <td class=
"description last"><p>The function to invoke on each poll interval.
</p></td>
325 <td class=
"name"><code>interval
</code></td>
331 <span class=
"param-type">number
</span>
341 <td class=
"description last"><p>The poll interval in seconds.
</p></td>
380 <dt class=
"tag-source">Source:
</dt>
381 <dd class=
"tag-source"><ul class=
"dummy"><li>
382 <a href=
"luci.js.html">luci.js
</a>,
<a href=
"luci.js.html#line1023">line
1023</a>
411 <div class=
"param-desc">
412 <p>Throws
<code>TypeError
</code> when an invalid interval was passed.
</p>
423 <span class=
"param-type">TypeError
</span>
439 <div class=
"param-desc">
440 <p>Returns
<code>true
</code> if the function has been added or
<code>false
</code> if it
441 already is registered.
</p>
452 <span class=
"param-type">boolean
</span>
470 <h4 class=
"name" id=
"remove"><span class=
"type-signature"></span>remove
<span class=
"signature">(fn)
</span><span class=
"type-signature"> → {boolean}
</span></h4>
477 <div class=
"description">
478 <p>Remove an operation from the polling loop. If no further operatons
479 are registered, the polling loop is implicitely stopped.
</p>
493 <table class=
"params">
506 <th class=
"last">Description
</th>
515 <td class=
"name"><code>fn
</code></td>
521 <span class=
"param-type">function
</span>
531 <td class=
"description last"><p>The function to remove.
</p></td>
570 <dt class=
"tag-source">Source:
</dt>
571 <dd class=
"tag-source"><ul class=
"dummy"><li>
572 <a href=
"luci.js.html">luci.js
</a>,
<a href=
"luci.js.html#line1064">line
1064</a>
601 <div class=
"param-desc">
602 <p>Throws
<code>TypeError
</code> when the given argument isn't a function.
</p>
613 <span class=
"param-type">TypeError
</span>
629 <div class=
"param-desc">
630 <p>Returns
<code>true
</code> if the function has been removed or
<code>false
</code> if it
642 <span class=
"param-type">boolean
</span>
660 <h4 class=
"name" id=
"start"><span class=
"type-signature"></span>start
<span class=
"signature">()
</span><span class=
"type-signature"> → {boolean}
</span></h4>
667 <div class=
"description">
668 <p>(Re)start the polling loop. Dispatches a custom
<code>poll-start
</code> event
669 to the
<code>document
</code> object upon successful start.
</p>
711 <dt class=
"tag-source">Source:
</dt>
712 <dd class=
"tag-source"><ul class=
"dummy"><li>
713 <a href=
"luci.js.html">luci.js
</a>,
<a href=
"luci.js.html#line1090">line
1090</a>
741 <div class=
"param-desc">
742 <p>Returns
<code>true
</code> if polling has been started (or if no functions
743 where registered) or
<code>false
</code> when the polling loop already runs.
</p>
754 <span class=
"param-type">boolean
</span>
772 <h4 class=
"name" id=
"stop"><span class=
"type-signature"></span>stop
<span class=
"signature">()
</span><span class=
"type-signature"> → {boolean}
</span></h4>
779 <div class=
"description">
780 <p>Stop the polling loop. Dispatches a custom
<code>poll-stop
</code> event
781 to the
<code>document
</code> object upon successful stop.
</p>
823 <dt class=
"tag-source">Source:
</dt>
824 <dd class=
"tag-source"><ul class=
"dummy"><li>
825 <a href=
"luci.js.html">luci.js
</a>,
<a href=
"luci.js.html#line1115">line
1115</a>
853 <div class=
"param-desc">
854 <p>Returns
<code>true
</code> if polling has been stopped or
<code>false
</code> if it din't
855 run to begin with.
</p>
866 <span class=
"param-type">boolean
</span>
894 <h2><a href=
"index.html">Home
</a></h2><h3>Classes
</h3><ul><li><a href=
"LuCI.html">LuCI
</a></li><li><a href=
"LuCI.Class.html">Class
</a></li><li><a href=
"LuCI.dom.html">dom
</a></li><li><a href=
"LuCI.fs.html">fs
</a></li><li><a href=
"LuCI.Headers.html">Headers
</a></li><li><a href=
"LuCI.Network.html">Network
</a></li><li><a href=
"LuCI.Network.Device.html">Device
</a></li><li><a href=
"LuCI.Network.Hosts.html">Hosts
</a></li><li><a href=
"LuCI.Network.Protocol.html">Protocol
</a></li><li><a href=
"LuCI.Network.WifiDevice.html">WifiDevice
</a></li><li><a href=
"LuCI.Network.WifiNetwork.html">WifiNetwork
</a></li><li><a href=
"LuCI.Poll.html">Poll
</a></li><li><a href=
"LuCI.Request.html">Request
</a></li><li><a href=
"LuCI.Request.poll.html">poll
</a></li><li><a href=
"LuCI.Response.html">Response
</a></li><li><a href=
"LuCI.rpc.html">rpc
</a></li><li><a href=
"LuCI.uci.html">uci
</a></li><li><a href=
"LuCI.view.html">view
</a></li><li><a href=
"LuCI.XHR.html">XHR
</a></li></ul>
900 Documentation generated by
<a href=
"https://github.com/jsdoc/jsdoc">JSDoc
3.6.3</a> on Tue Nov
05 2019 09:
33:
05 GMT+
0100 (Central European Standard Time)
903 <script> prettyPrint();
</script>
904 <script src=
"scripts/linenumber.js"> </script>