This topic contains 3 replies, has 3 voices, and was last updated by  Eliot Muir 6 years, 1 month ago.

Executing multiple, concurrent statements

  • I’m looking for a way to perform parallel processing in a translator instance.
    I’m aware of coroutine.wrap/resume/yield but it doesn’t look like these will work to accomplish my goal.
    Basically, I’d like to launch multiple, concurrent net.http.get calls to one or more web services. Right now the only way I can see to handle these calls is to make them serially, one after the other.

    Has anyone been able to do something like this?
    Thanks,
    Casey.

    Currently the only way to implement the sort of “pure Iguana” parallelism you’re looking for is across multiple channels, which will be an interesting exercise if any sort of synchronization/orchestration is required between processes.

    You could develop your multi-threaded code in some other language, delivering its payload to Iguana through a “From HTTP(S)” channel. While configured as a single channel, The “From HTTP(S)” option gives you the ability to allocate multiple threads for concurrent processing (note that each thread consumes a channel license). I’m not sure this buys you much, though, as any message events queue.push{}ed will be processed serially by the downstream filter/translator/endpoint.

    My comments are, of course, couched in an empirical understanding of Iguana’s workings. For a true “under the covers” view, I’d ask for someone at Interfaceware to chime in 🙂

    Jeff Drumm â—Š VP and COO â—Š HICG, LLC. â—Š http://www.hicgrp.com

    Thanks for your reply, Jeff.
    You’re right and Interfaceware support has confirmed.
    I suspected as much when I realized that the coroutine library isn’t supported in the iguana runtime. From what I can tell about the Lua language, that’s about the only built-in mechanism that might accomplish this.

    So, I’ll need to look at other mechanisms for scaling out these web calls.

    I have some ideas of how you could do this in the present version of Iguana using a FROM HTTPS channel.

    Set up an instance that has 10 threads. Get the channel to return an ID of translation with net.http.respond. Then store the results of the call using the store2 module. It’s a bit of a hack but it would do allow a bunch of calls to be fired off and store the results for later access.

    Reach out to me via email.

You must be logged in to reply to this topic.