Logging value after exiting the loop

Hi,

In my current project we use following loop:

.asLongAsDuring(session => session(“currentResponseStatus”).as[String] != “200”, GlobalVariables.timeout) { exec … }

We’d want to log an information in the console when the loop exits after timeout. Is there any possibility to do this? I couldn’t find any callback or something like that to use in such case.

I will be grateful for any case or suggestion of a solution.

Best regards,
Stefania

What don’t you print after the loop?

asLongAsDuring() {???)
.exec { session =>
println(session(“currentResponseStatus”).as[String])
session
}

Stephane,

Cause it doesn’t cover the case I’ve described. I only want to do sth like:
.asLongAsDuring(session => session(“currentResponseStatus”).as[String] != “200”, GlobalVariables.timeout) { … }
If (timeout occurs) then printl (“Maximum response time reached”).

I want to differ cases when the request cannot be processed by the system in a given time from the rest of the requests.

Kind regards,
Stefania

If status is not 200, it means timeout was reached, right? Or am I missing something?