Dealing with asynchronous results handling.

Ask a Question related to Macromedia Flex General Discussion, Design and Development.

  1. #1

    Default Re: Dealing with asynchronous results handling.

    Thanks for the information so far.

    The first response seems to be an example of chaining (i.e. results from one
    service call, calls the next service) which I'm trying to avoid. If I
    misunderstood, let me know.

    I have looked at the "call" object and that may be helpful. Acutally the Flex
    manuals mention this in combination with the ACT (Asynchronous Completion
    Token?) pattern. That should be useful for keeping track of requests that
    have completed.

    One thought I had was to send in an array or tree of functions. The idea
    being to load up the array with the services I want to call and the order I
    want them called. Each result handler will take itself out of the array and
    then call the next function in the array. When the array/tree is depleated, we
    know we're done.

    Haven't tried to code this up yet. Not sure if I can create create such a
    array/tree in ActionScript. I'll let you know if that works out.

    jff_ebt Guest

  2. Similar Questions and Discussions

    1. Query results don't display properly in results table.IGNORE PREVIOUS
      :disgust; I need to display the results of a query. The query runs properly. My problem is having specific results display in specific locations in...
    2. handling exceptions in asynchronous web service calls
      I have a win forms application that calls a web service asynchronously. Occassionally, the web service call with raise an exception. Unfortunately,...
    3. dealing with the filesystem?
      In Flash, How it is possible to create directorys and files etc? Can someone post some links or examples please?
    4. Dealing with categories
      Hi All I know this is a 'find out yourself in your environment...' type query, but if I don't ask..... Basically my query is whats the best...
    5. Dealing with SIGHUP
      I recently read a mailing list 'posting' that claimed that if one typed (program arguments) </dev/null >> stdout 2>>stderr & that the...
  3. #2

    Default Re: Dealing with asynchronous results handling.

    I use a similar strategy in some cases. Sometimes a value array will require
    two or more queires be completed before it is usable.

    When the query(data service send()) is invoked, I add an entry to an array
    with the id of the query, and store the id in the call object. When a result
    event calls the handler, I get the id of the calling request, remove the
    matching element from the array. When the array is empty, the data array is
    ready to be assigned to a dataProvider property.

    ntsiii Guest

  4. #3

    Default Re: Dealing with asynchronous results handling.

    And yes, you can actually pass a function to the call object, and run it rom the result handler. I have not tried this yet, though.
    ntsiii Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139