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
| JobHandle | A handle returned by StartPrefetch |
|---|---|
| TimeoutMS | The maximum time to wait in milliseconds; INFINITE waits until the job reaches a terminal state |
Return values
| 3 | PLNET_PREFETCH_STATE_COMPLETED |
|---|---|
| 4 | PLNET_PREFETCH_STATE_CANCELLED |
| 5 | PLNET_PREFETCH_STATE_FAILED |
| 6 | PLNET_PREFETCH_STATE_LIMIT_REACHED |
| 0 | The 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