httpGet timeout

According to “Calling Web Services in SmartApps”, the timeout for the http methods (e.g. httpGet) should be 20 seconds.
I consistently see these calls timeout after exactly 10 seconds.
Has anyone else noticed this? Is this simply an error in the documentation?

I’ll look into this - thanks.

@yoni_rabinovitch you are correct, we set a timeout limit of 10 seconds for the web services APIs. I’ve updated that document.

Just an FYI, the twenty second timeout applies to the time limit for any code block to execute. That still is true. We don’t currently document that very well; it’s on our to-do list to make that clearer.

I am curious about what web service you are calling that is taking so long?

Jim, when I tried to implement long polling, a 20 second execution timeout kind of killed it for me. Are you aware of any other way to make long polling work?

Hi @625alex and @yoni_rabinovitch,

Long polling is tough. The system is designed for smartapps to be event driven, and short-lived processes that come alive when a subscription matches something they’re interested in. They execute, and they go away until the next time something of interest happens.

Is long polling your only option? Does the web service support callbacks? Ideally, there would be some sort of true push mechanism. You could provide a callback url to the web service, and it could call back to your app when there was data available.

Due to the lack of push mechanism, frequent polling is the only alternative to long polling. There is no middle man between my server and the client.