Monday, November 08, 2010 at 12:06 AM.
system.verbs.builtins.tcp.im.builtinDrivers.jabber.code.waitForIqReply
on waitForIqReply ( id, timeout = 60) {
<<Changes
<<5/14/02; 1:51:34 PM by JB
<<Changelog created.
<<This will wait for the iq message to come back, and be fully processed, before returning control to the caller
<<See rationale in jabber.idTables.create for more info. This script is so simple because of the surrounding infrastructure.
on mungeId ( idStr ) {
// this munges the id string into a semaphore name, this scriptlet will be copied into several places.
if typeOf ( idStr ) == addressType {
idStr = nameOf ( idStr^ )};
return "JabberIQTagSem" + idStr};
try {
semaphore.lock(mungeId(id), timeout * 60)}
else { // provide a nicer scriptError, more descriptive of the problem
scriptError ( "Can't wait until iq tag reply comes back because the reply took too long to come back." )};
semaphore.unlock(mungeId(id));
return}
This listing is for code that runs in the OPML Editor environment. I created these listings because I wanted the search engines to index it, so that when I want to look up something in my codebase I don't have to use the much slower search functionality in my object database. Dave Winer.