Connectivity

fun Connectivity(options: HttpConnectivityOptions = HttpConnectivityOptions(), scope: CoroutineScope = CoroutineScope(Dispatchers.Default), httpClient: HttpClient = HttpClient()): Connectivity

Creates a Connectivity instance for HTTP.

Return

A Connectivity instance.

Parameters

options

The HttpConnectivityOptions used to configure the connectivity monitoring. Defaults to a new HttpConnectivityOptions instance.

scope

The CoroutineScope in which the connectivity monitoring will be launched. Defaults to a new CoroutineScope with Dispatchers.Default.

httpClient

The HttpClient used to make HTTP requests. Defaults to a new HttpClient instance.


fun Connectivity(scope: CoroutineScope = CoroutineScope(Dispatchers.Default), httpClient: HttpClient = HttpClient(), options: HttpConnectivityOptions.Builder.() -> Unit): Connectivity

Creates a Connectivity instance for HTTP using a builder pattern for the HttpConnectivityOptions.

Return

A Connectivity instance.

Parameters

scope

The CoroutineScope in which the connectivity monitoring will be launched. Defaults to a new CoroutineScope with Dispatchers.Default.

httpClient

The HttpClient used to make HTTP requests. Defaults to a new HttpClient instance.

options

A lambda function that configures the HttpConnectivityOptions.Builder.