NetworkResponseProducer

class NetworkResponseProducer(resourceRetriever: ResourceRetriever, backgroundDispatcher: CoroutineDispatcher) : ResponseProducer

A ResponseProducer subclass that produces responses from the network

Parameters

resourceRetriever
backgroundDispatcher

the CoroutineDispatcher to use for doing all operations

Constructors

NetworkResponseProducer
Link copied to clipboard
fun NetworkResponseProducer(resourceRetriever: ResourceRetriever, backgroundDispatcher: CoroutineDispatcher = Dispatchers.IO)

Functions

canHandleRequest
Link copied to clipboard
open override fun canHandleRequest(request: Metador.Request): Boolean
Returns whether this entity can handle the specified request
produceResponse
Link copied to clipboard
open suspend override fun produceResponse(request: Metador.Request): Result<Map<String, String>, Throwable>
Produces a response from the specified request.