Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread EWB1 <-> EWB2: Differnt behaviour in request queue
Sat, Oct 10 2015 9:29 AMPermanent Link

Christian Kaufmann

It looks like there is a change in handling requests when a request has a status code other than
200. The request remains in the queue and when I add a new request, only this pending request will
be executed, but not the new one.

I'm not sure if this is by design or an unwanted side effect.


I use code 403 and 404 like shown in the following code. In any case the request should be
descarded and not be executed again.


procedure TBSServer.RequestComplete(Request: TServerRequest);
begin
 case Request.StatusCode of
 200:
   // my default handling goes here
 251:
   begin
     msg := Request.ResponseContent.Values['Message'];
     if msg <> ''
       then ShowMessage(msg);
   end;
 403:
   begin
     msg := Request.ResponseContent.Values['Message'];
     if msg = ''
       then msg := 'Unauthorized access!';
     ShowMessage(msg);
   end;
 404:
   begin
     msg := Request.ResponseContent.Values['Message'];
     if msg = ''
       then msg := 'Invalid request!';
     ShowMessage(msg);
   end;
 else
   ShowMessage('No connection to swimrankings.net Server');
 end;
end;

cu Christian
Sat, Oct 10 2015 11:17 AMPermanent Link

Raul

Team Elevate Team Elevate

"Christian Kaufmann" wrote:
<<
It looks like there is a change in handling requests when a request has a status code other than
200. The request remains in the queue and when I add a new request, only this pending request will
be executed, but not the new one.

I'm not sure if this is by design or an unwanted side effect.
>>

By design - it makes things lot easier as otherwise app code would have to constantly deal with retries and ordering of requests (especially if you ever work on dataset level).

<<
I use code 403 and 404 like shown in the following code. In any case the request should be
descarded and not be executed again.
>>

You can just call CancelRequest and by passing in True as param rest will continue to execute other requests.

See manual for some more detail :
http://www.elevatesoft.com/manual?action=viewtopic&id=ewb2&topic=Executing_Request

Raul
Sat, Oct 10 2015 1:53 PMPermanent Link

Christian Kaufmann

> See manual for some more detail :
> http://www.elevatesoft.com/manual?action=viewtopic&id=ewb2&topic=Executing_Request

Thanks. Works fine with CancelRequest for status <> 200-299.

cu Christian
Image