|
From: <mi...@st...> - 2002-06-28 07:22:50
|
Leif Hedstrom wrote:
> I think you want to do the sleep only if ldap_result[0] is None, otherwise
> you'll cause a sleep every loop, regardless if data is available or not.
???
while ldap_result[0] is None:
if (timeout>=0) and (time.time()-start_time>timeout):
self._ldap_call(self._l.abandon,msgid)
raise _ldap.TIMELIMIT_EXCEEDED(
"LDAP time limit (%d secs) exceeded." % (timeout)
)
time.sleep(0.0001)
ldap_result = self._ldap_call(self._l.result,msgid,0,0)
> That's why I originally put it after the call to result() inside the polling
> loop.
Note that there is a first call to self._l.result() outside both
while-loops and the time.sleep() is in the inner loop (while
ldap_result[0] is None:). IMHO it should be equivalent.
Ciao, Michael.
|