type TPdfRangeRequestScheduler = class ... end;
| Method | Description |
|---|---|
Create | Creates an empty scheduler with two retries and no request-size limit |
Destroy | Releases scheduler state and its synchronisation primitive |
Reset(AFileSize) | Cancels active transport work, begins a new generation, clears counters and optionally enforces a logical file bound |
Cancel | Clears queued work, invalidates in-flight request generations and raises OnCancelRequest outside the scheduler lock |
MarkAvailable(Offset, Size) | Records externally supplied bytes, removes pending overlap and cancels redundant active transfers |
EnqueueHints(Hints, Priority) | Adds missing intervals, preserves exact priority and retry boundaries, and pre-empts overlapping lower-priority transfers |
TryDequeue(out Request) | Returns the highest-priority lowest-offset bounded request and marks it in flight |
CompleteRequest(Request) | Marks a complete response available after the host has stored its bytes |
CompleteRequest(Request, BytesReceived) | Commits a short response prefix and requeues or abandons the remainder under the retry limit |
FailRequest(Request) | Retries or abandons an in-flight request under MaxRetryCount |
IsRangeAvailable(Offset, Size) | Tests whether completed intervals fully cover a range |
DataAvailable | Adapts completed-range lookup to TPdfDataAvailableEvent |
CopyCompletedRanges | Returns a stable snapshot of merged available intervals |
CopyStatistics | Copies counters through a C++Builder-friendly method |
| Member | Type | Description |
|---|---|---|
Cancelled | Boolean | Whether the active generation has been cancelled |
FileSize | UInt64 | Logical request bound, or zero for an unbounded standalone scheduler |
MergeGap | UInt64 | Maximum uncovered gap eligible for merging when it crosses no available or in-flight bytes |
MaxRequestSize | UInt64 | Maximum size returned by one TryDequeue call |
MaxRetryCount | Integer | Number of retries after the initial transport attempt |
Statistics | TPdfRangeRequestStatistics | Atomic snapshot covering PendingRequestCount, InFlightRequestCount, AvailableRangeCount, the PendingBytes, InFlightBytes, CompletedBytes and TransferredBytes byte counters, and the FailedAttemptCount, RetriedRequestCount, AbandonedRequestCount, DequeuedRequestCount, CompletedRequestCount, PartialRequestCount, CancelledRequestCount, and SupersededRequestCount totals |
OnCancelRequest | TPdfRangeRequestCancelEvent | Requests cancellation of one active transport operation by request ID and attempt |
rrpImmediate is dequeued before rrpNormal, then rrpBackgroundMergeGap, preventing duplicate transferAttemptvar
Request: TPdfRangeRequest;
begin
while Scheduler.TryDequeue(Request) do
begin
try
WriteRangeResponse(Request.Offset, Request.Size);
Scheduler.CompleteRequest(Request);
except
Scheduler.FailRequest(Request);
end;
end;
end;
CompleteRequestTStream.Position remains the host's synchronisation responsibility; use positioned I/O or an external stream lockOnCancelRequest runs outside the internal lock for session cancellation, priority pre-emption and redundant-transfer cancellationTPdfRangeRequest,
TPdfRangeRequests,
TPdfRangeRequestPriority,
TPdfRangeRequestStatistics,
TPdfRangeRequestCancelEvent,
TPdfProgressiveDocument