Skip to content

Instantly share code, notes, and snippets.

{
"link": "https://mobile.envelo.pl/docs/regulamin.html",
"version": 1416836788
}
Completable.fromCallable { animalsMaker.makeCat(getThread()) }
.doOnComplete { animalsMaker.makeDog(getThread()) }
.observeOn(scheduler(FISH))
.andThen(Completable.fromCallable { animalsMaker.makeShark(getThread()) })
.andThen(
Completable.fromCallable { animalsMaker.makeChicken(getThread()) }
.subscribeOn(scheduler(BIRDS))
.andThen(Completable.fromCallable { animalsMaker.makeDuck(getThread()) })
)
.andThen(Completable.fromCallable { animalsMaker.makePenguin(getThread()) })
getUsers()
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe({ showUsers(it) })
-- Check for working C compiler: /Users/{user}/Library/Android/sdk/ndk-bundle/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang
-- Check for working C compiler: /Users/{user}/Library/Android/sdk/ndk-bundle/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /Users/{user}/Library/Android/sdk/ndk-bundle/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++
-- Check for working CXX compiler: /Users/{user}/Library/Android/sdk/ndk-bundle/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
cmake_minimum_required(VERSION 3.0)
link_directories( ${CMAKE_CURRENT_SOURCE_DIR} )
option(desktop_build "desktop_build" ON)
message("-- desktop_build: " ${desktop_build})
# STRING(REPLACE "-O3" "-O0" CMAKE_CXX_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE})
add_subdirectory(3rd_party/dlib)
add_subdirectory(3rd_party/nlohmann_json)
add_subdirectory(3rd_party/optional-lite)
plugins {
kotlin("multiplatform")
id("com.android.library")
kotlin("kapt")
}
kotlin {
//...
sourceSets {
@ToNativeClass(name = "LoadUserUseCaseIos", launchOnScope = MainScopeProvider::class)
class LoadUserUseCase(private val service: UserService){
suspend fun loadUser(username: String) : User? = service.loadUser(username)
fun getUserBlocking(username: String) : User? = service.getUser(username)
}
@ToNativeClass(name = "ObserveUsersUseCaseIos", launchOnScope = MainScopeProvider::class)
public class SaveUserUseCaseIos(
private val wrapped: SaveUserUseCase
) {
public fun saveUser(user: User): SuspendWrapper<Unit> =
SuspendWrapper(exportedScopeProvider_mainScopeProvider) { wrapped.saveUser(user) }
}
@ExportedScopeProvider
class MainScopeProvider : ScopeProvider {
override val scope : CoroutineScope = MainScope()
}
val commonModule = module {
single { UserService() }
factory { LoadUserUseCase(get()) }
factory { SaveUserUseCase(get()) }
factory { ObserveUsersUseCase(get()) }
}