AWS.SQS.ISQSQueuePoller.OnBeforeRequest

Optionally specify an OnBeforeRequest to receive a callback before each Poll request is started. The handler method is provided with polling statistics.

property OnBeforeRequest: TSQSQueuePollerBeforeRequestHandler;
__property TSQSQueuePollerBeforeRequestHandler OnBeforeRequest;

File: AWS.SQS.pas 

Namespace: AWS.SQS 

Module: Appercept AWS SDK for Delphi 

var QueueUrl := 'https://...'; var Poller := TSQSQueuePoller.Create(QueueUrl) as ISQSQueuePoller; Poller.OnBeforeRequest := procedure(const APoller: ISQSQueuePoller; const AStats: TSQSQueuePollerStatistics) begin if AStats.RequestCount = 0 then Log(Format('Polling started at %s', [FormatDateTime('c', AStats.PollingStartedAt)])) else Log(Format('Polling iteration %d', [AStats.RequestCount])); Log(Format('Messages received to date %d', [AStats.ReceivedMessageCount])); end;
Copyright © 2019-2021 Appercept Ltd. All rights reserved.