Sending multiple web requests by expression

expression

#1

Looking for some assistance, I am using http commands to control some camera functions and was wondering if you can included 2 separate http commands to 2 different IP address all in the same expression? Is this possible, if so how?


#2

I don’t see how it would be. But why would it have to be in the same expression? why couldn’t it be 4?


#3

I am already doing that, the issue is, it seems a 15 second delay is being added between commands. I was trying to see if I can send multiple web requests in the same command to eliminate the delay.


#4

Use an async group.


#5

You have an example of that?


#6

There are a bunch in the example pistons. I can send you one when I am in front of my PC again.


#7

Pleas do


#8

This is a small one but you can import it with the backup code. You create a do block and set the execution policy to asynchronous.


#9

Unfortunately this does not work. I think normally you would have multiple async blocks, but regardless it seems webCoRE is only able to handle one request at a time. See this variant which uses an API that mocks slow response times. I set it to a 3 second delay to load google.com

This logs the following:

10/29/2018, 6:39:52 PM +253ms
+6668ms ║Done with batch 1
+13149ms ║Done with batch 2

Despite the async blocks, all requests are done in series so it takes over 12 seconds to run rather than the 3 to 6 we would expect with parallel requests.

This question came up last year; there is at least one solution but it’s ugly:


#10

Is it possible the same is happening on this one? When I first put together the piston I was only doing Log to console.


#11

I have several pistons, where webcore is actually adding a 15 second delay and doing the count down until the next web request. Regardless if there is a wait added or not.


#12

The Hack way of trying to fix this will never work for me. It would take way too many pistons. I guess I will just live with the way it is.