• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
RunLoops, WebServices Framework, and WSMakeStubs
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RunLoops, WebServices Framework, and WSMakeStubs


  • Subject: RunLoops, WebServices Framework, and WSMakeStubs
  • From: Joseph Heck <email@hidden>
  • Date: Mon, 30 May 2005 20:00:10 -0700

I have been spending the weekend disecting code from WSMakeStubs and getting into the depths of the WebServices framework, and I'm having some trouble understanding a section of code.

When you use WSMakeStubs, it generates a pretty standard template object (WSGeneratedObj) which has within it a getResultsDictionary method. Prior to it's getting to this method, it's established the WSMethodInvocationRef with an asynchronous callback. So far, I'm all with this plan of attack. Then we get into this method:

The method in question:

- (NSDictionary*) getResultDictionary
{

    if (fResult == NULL) {
        if (fAsyncTarget != NULL) {
            fAsyncTarget = NULL;
            fAsyncSelector = NULL;
        }

        if (fResult == NULL) {
            WSMethodInvocationRef invocation = [self getRef];
            CFStringRef wsGeneratedMode = CFSTR("NS-WSSYNC");

            WSMethodInvocationScheduleWithRunLoop(invocation, CFRunLoopGetCurrent(), wsGeneratedMode);

            while (fResult == NULL)
                CFRunLoopRunInMode(wsGeneratedMode, -1.0, true);

            WSMethodInvocationUnscheduleFromRunLoop(invocation, CFRunLoopGetCurrent(), wsGeneratedMode);

        }

        

        if (fResult == NULL) {
            [self handleError:@"WSMethodInvocationInvoke failed in getResultDictionary" errorString:NULL errorDomain:kCFStreamErrorDomainMacOSStatus errorNumber:paramErr];
        }
    }
    return fResult;
}

What I don't understand is the call to CFRunLoopRunInMode. The documentation on CFRunLoopRunInMode talks about running a runloop for 0 seconds, and > 0 seconds, but doesn't say anything about < 0 seconds. 

Is this method call a mechanism to guarantee that the scheduled invocation will get called and when this method returns it will have definitively been invoked?

-joe
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: [Moderator] EOT Re: WWDC 2005 Suggestion
  • Next by Date: Re: Exception raised during posting of notification
  • Previous by thread: Re: Cocoa binding question
  • Next by thread: Setting the cursor for a link in an NSTextView
  • Index(es):
    • Date
    • Thread