WaitForPrefetch

Document management, Performance, Concurrency

Description

Blocks until a prefetch job reaches a terminal state or the timeout expires, and returns that state

Syntax

Delphi

Function TByteRangeStream.WaitForPrefetch(JobHandle: Integer; TimeoutMS: Cardinal): Integer;

Parameters

JobHandleA handle returned by StartPrefetch
TimeoutMSThe maximum time to wait in milliseconds; INFINITE waits until the job reaches a terminal state

Return values

3PLNET_PREFETCH_STATE_COMPLETED
4PLNET_PREFETCH_STATE_CANCELLED
5PLNET_PREFETCH_STATE_FAILED
6PLNET_PREFETCH_STATE_LIMIT_REACHED
0The timeout expired, the handle is invalid, or no prefetch job was ever started on this stream

Remarks

A job that is already in a terminal state returns immediately

GetPrefetchState reports the state, including queued and running, without waiting

See also

WaitForRangeSourcePrefetch, GetRangeSourcePrefetchState, StartRangeSourcePrefetch