fetch

suspend fun fetch(url: Url, configure: FetchSpec.() -> Unit = {}): Result<FeedFetch>(source)

As the overload with validators, with FeedValidators.None: an unconditional request, so a 304 is an UpstreamError.

Return

FeedFetch.Fetched, or a failure (see the class description).

Parameters

url

the feed's URL.

configure

sets the cost, lane and maxWait of this fetch, passed to UrlFetcher.fetch.

Throws

kotlinx.coroutines.CancellationException

if the caller is cancelled (a parse already running is not interrupted).

if a component throws one.


suspend fun fetch(url: Url, validators: FeedValidators, configure: FetchSpec.() -> Unit = {}): Result<FeedFetch>(source)

Fetches url conditionally.

Return

FeedFetch.Fetched or FeedFetch.NotModified, or a failure (see the class description).

Parameters

url

the feed's URL.

validators

what the last response gave (or FeedValidators.None); sent verbatim.

configure

sets the cost, lane and maxWait of this fetch, passed to UrlFetcher.fetch.

Throws

kotlinx.coroutines.CancellationException

if the caller is cancelled (a parse already running is not interrupted).

if a component throws one.