IPLByteRangePrefetchPlanner

Data types

Description

Callback contract used by StartPrefetch: the worker calls BuildNextPlan once per pass to learn which byte ranges to fetch next

The planner inspects the document state through the supplied control and returns the ranges for the pass together with an availability status and a report

Syntax

Delphi

IPLByteRangePrefetchPlanner = Interface
  Function BuildNextPlan(Control: IPLByteRangePrefetchReadControl;
    Out Ranges: TPDFByteRangeArray; Out AvailabilityStatus: Integer;
    Out Report: WideString): Boolean;
End;

Remarks

Returning False finishes the job as failed with a dependency-plan failure unless the job was cancelled or had already reached its byte budget

An availability status of 1 or 2 completes the job, a negative value fails it as an invalid dependency plan, and 0 keeps planning while ranges remain

Ranges are normalized against the source size, chunk size and read-ahead before reading; a pass that yields no ranges after normalization fails the job as stalled

Report is stored with the job and returned by GetPrefetchInfo

An exception raised by the planner fails the job with the exception message

See also

IPLByteRangePrefetchReadControl, StartPrefetch, GetPrefetchInfo, GetPrefetchState, CancelPrefetch, WaitForPrefetch