bismarck-serializer-kotlinx

KotlinX bindings for Bismarck

Лицензия

Лицензия

Категории

Категории

Kotlin Языки программирования Сеть JSON Данные
Группа

Группа

net.sarazan
Идентификатор

Идентификатор

bismarck-kotlinx-json
Последняя версия

Последняя версия

0.3.2
Дата

Дата

Тип

Тип

pom
Описание

Описание

bismarck-serializer-kotlinx
KotlinX bindings for Bismarck
Ссылка на сайт

Ссылка на сайт

https://github.com/asarazan/bismarck
Система контроля версий

Система контроля версий

https://github.com/asarazan/bismarck

Скачать bismarck-kotlinx-json

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/net.sarazan/bismarck-kotlinx-json/ -->
<dependency>
    <groupId>net.sarazan</groupId>
    <artifactId>bismarck-kotlinx-json</artifactId>
    <version>0.3.2</version>
    <type>pom</type>
</dependency>
// https://jarcasting.com/artifacts/net.sarazan/bismarck-kotlinx-json/
implementation 'net.sarazan:bismarck-kotlinx-json:0.3.2'
// https://jarcasting.com/artifacts/net.sarazan/bismarck-kotlinx-json/
implementation ("net.sarazan:bismarck-kotlinx-json:0.3.2")
'net.sarazan:bismarck-kotlinx-json:pom:0.3.2'
<dependency org="net.sarazan" name="bismarck-kotlinx-json" rev="0.3.2">
  <artifact name="bismarck-kotlinx-json" type="pom" />
</dependency>
@Grapes(
@Grab(group='net.sarazan', module='bismarck-kotlinx-json', version='0.3.2')
)
libraryDependencies += "net.sarazan" % "bismarck-kotlinx-json" % "0.3.2"
[net.sarazan/bismarck-kotlinx-json "0.3.2"]

Зависимости

Библиотека не имеет зависимостей. Это самодостаточное приложение, которое не зависит ни от каких других библиотек.

Модули Проекта

Данный проект не имеет модулей.

Bismarck (it syncs)

A new caching/syncing library for Kotlin Multiplatform

Under heavy construction. Better examples and instructions coming soon.

val cache = Bismarck.create<UserRecords> {
    fileStorage { 
        path = "users.json"
        serializer = JsonSerializer(UserRecords.serializer()) // requires bismarck-serializer-kotlinx
    }
    freshness { 
        path = "users-freshness" // freshness state will survive shutdowns if you specify a path
        millis = 15 * 60 * 1000 // data is considered fresh for 15 minutes
    }
    fetcher {
        myApi.fetchAndProcessHundredsOfRecords()
    }
}

// Kick off a fetch with either check() or invalidate()
cache.check()

// Bismarck is coroutine-driven, 
// so async and observations should be scoped.
someScope.launch {

    // This will be called whenever the data is updated, as long as the scope continues.
    cache.eachValue {
        println("Received value ${it.bar}")
    }
    
    // It's helpful to know what your cache is doing. Observe state to find out!
    cache.eachState {
        spinner.isVisible = it == Bismarck.State.Fetching
    }
    
    // Same for error states!
    cache.eachError {
        warningIcon.isVisible = it != null
    }
}

// You can also grab all of these values directly
val current = cache.value

Installation

repositories {
    maven { url  "https://dl.bintray.com/asarazan/maven" }
}
//...
sourceSets {
    commonMain {
        dependencies {
            implementation "net.sarazan:bismarck:$bismarck_version" // currently 0.1.0
        }
    }
}

Версии библиотеки

Версия
0.3.2