SkillAgentSearch skills...

Peanut

A minimal Android library to handle heavy works in worker threads

Install / Use

/learn @savepopulation/Peanut
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

peanut

Android Arsenal <br>A minimal Android library to handle heavy works in worker threads easily.

How to use?

It's really easy to use.<br>

Create your peanut.

val peanut = object : Peanut<String>() {
            override fun call() {
                var count = 0
                for (i in 0 until 100000) {
                    count += count
                }
                onSuccess(count.toString())
            }
}

and Schedule it

peanut.runOn(Schedulers.io())
                .receiveOn(Schedulers.main())
                .run(object : Peanut.Subscriber<String> {

                    override fun onComplete(data: String) {
                        count.text = data
                    }

                    override fun onError(e: Error) {
                        e.printStackTrace()
                    }
})

Dependency

Add it in your root build.gradle at the end of repositories:

allprojects {
	repositories {
		...
		maven { url 'https://jitpack.io' }
	}
}

Add the dependency

dependencies {
	 implementation 'com.github.savepopulation:peanut:v1.0.0'
}
View on GitHub
GitHub Stars53
CategoryDevelopment
Updated8mo ago
Forks2

Languages

Kotlin

Security Score

77/100

Audited on Aug 1, 2025

No findings