Methods
-
Alias for
LuCI.poll.active(). -
Register a repeating HTTP request with an optional callback to invoke whenever a response for the request is received.
Name Type Description intervalnumber The poll interval in seconds.
urlstring The URL to request on each poll.
optionsLuCI.request.RequestOptions optional Additional options to configure the request.
callbackLuCI.request.poll~callbackFn optional Callbackfunction to invoke for each HTTP reply.Throws:
-
Throws
TypeErrorwhen an invalid interval was passed. - Type
- TypeError
Returns:
Type Description function Returns the internally created poll function. -
-
Remove a polling request that has been previously added using
add(). This function is essentially a wrapper aroundLuCI.poll.remove().Name Type Description entryfunction The poll function returned by
add().Returns:
Type Description boolean Returns trueif any function has been removed, elsefalse. -
Alias for
LuCI.poll.start(). -
Alias for
LuCI.poll.stop().
Type Definitions
-
The callback function is invoked whenever an HTTP reply to a polled request is received or when the polled request timed out.
Name Type Description resLuCI.response The HTTP response object.
data* The response JSON if the response could be parsed as such, else
null.durationnumber The total duration of the request in milliseconds.