<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hi Cristian, nice to see you here :)<br>
<br>
The function getPCIDeviceCompanions tooks almost two second for each
interation. As this function being called each time that the Edit
button is accessed, i want to cache the values on kimchi.main() to
save time.<br>
<br>
On systems that has too much pci devices, a popup from the browser
asks for quit the page by unresponsible script.<br>
<br>
<div class="moz-cite-prefix">On 07/14/2015 09:14 AM, Crístian Viana
wrote:<br>
</div>
<blockquote
cite="mid:CADqiwxzJqmDXzRfqP1=UFTHq81JguA2BytQkwsdz0O2LgBM0RQ@mail.gmail.com"
type="cite">
<div dir="ltr">The function "<span
style="font-size:13.1999998092651px;line-height:19.7999992370605px">kimchi.</span><span
style="font-size:13.1999998092651px;line-height:19.7999992370605px">getPCIDeviceCompanions"
(and most other Kimchi JavaScript functions, actually)
receives a callback function which receives a result
parameter. That function should be executed when the result is
ready. In your case, your parameter function doesn't match
this requirement (i.e. you're passing a function which
receives a function which receives a parameter). You need to
pass parameters exactly as they're expected by the main
function.</span>
<div><span
style="font-size:13.1999998092651px;line-height:19.7999992370605px"><br>
</span></div>
<div>Also, why are you using setTimeout at all?</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr">On Fri, Jul 10, 2015 at 5:57 PM Ramon Medeiros
<<a moz-do-not-send="true"
href="mailto:ramonn@linux.vnet.ibm.com">ramonn@linux.vnet.ibm.com</a>>
wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">Hi team,<br>
<br>
i was trying to cache 2 objects, but they came from a HTTP
request, and<br>
took some time to download it. I was unable to use the
function<br>
setTimeout while calling this function:<br>
<br>
kimchi.getPCIDeviceCompanions(kimchi.hostPCIs[i].name,<br>
setTimeout(function(result) {<br>
kimchi.deviceCompanions[kimchi.hostPCIs[i].name] =
result;<br>
},5000));<br>
}<br>
<br>
<br>
The function kimchi.getPCIDeviceCompanions usually takes 2s to
finish.<br>
<br>
--<br>
<br>
Ramon Nunes Medeiros<br>
Kimchi Developer<br>
Linux Technology Center Brazil<br>
IBM Systems & Technology Group<br>
Phone : +55 19 2132 7878<br>
<a moz-do-not-send="true" href="mailto:ramonn@br.ibm.com"
target="_blank">ramonn@br.ibm.com</a><br>
<br>
_______________________________________________<br>
Kimchi-devel mailing list<br>
<a moz-do-not-send="true" href="mailto:Kimchi-devel@ovirt.org"
target="_blank">Kimchi-devel@ovirt.org</a><br>
<a moz-do-not-send="true"
href="http://lists.ovirt.org/mailman/listinfo/kimchi-devel"
rel="noreferrer" target="_blank">http://lists.ovirt.org/mailman/listinfo/kimchi-devel</a><br>
</blockquote>
</div>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
Ramon Nunes Medeiros
Kimchi Developer
Linux Technology Center Brazil
IBM Systems & Technology Group
Phone : +55 19 2132 7878
<a class="moz-txt-link-abbreviated" href="mailto:ramonn@br.ibm.com">ramonn@br.ibm.com</a> </pre>
</body>
</html>