handling near real time updates

adamfenn28's picture

I have several patches that need pull data down from a series of urls. I use async url fetches. I can pull the url during the first frame after I trigger a refresh signal through an input port on my patches. However, the data is not processed and published to my output ports until the next frame loads. I want this to happen immediately after the url is loaded. I think I have at least two options.

  1. I can leave the time mode to kQCPlugInTimeModeNone, which will only update when I trigger the next refresh. I could trigger a second refresh through the composition. This keeps CPU low but keeps seems like kind of a hack to me.

  2. I can change the time mode to kQCPlugInTimeModeIdle, updates automatically, and very quickly. However, this method chews up a lot more CPU.

  3. Something else.

Do I understand these options correctly, or is there something better I can do.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

cwright's picture
Re: handling near real time updates

1 doesn't seem safely possible (there's currently no supported way to force a composition to re-evaluate)

2's the designated "right" way to do this for now.

3 seems like an empty set -- if you're willing to write your own processing engine you can have it do clever stuff, and also have it drive the composition when appropriate. This is correct and nets you all the goodness of 1 with all the responsiveness of 2. It also consumes a lot of time getting it up and running (though not too much).