Skip to content

KingFalse/harrier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 

Repository files navigation

harrier

Maven Central

Simpler use of multithreading in Kotlin

Example

@Test
fun mapMultithreading() {
    (1..10).mapMultithreading {åçç
        println("--->${Thread.currentThread().name}")
        Thread.sleep(1000)
    }
}

@Test
fun mapMultithreadingWithCount() {
    val resultList = (1..10).mapMultithreading(10) {
        Thread.sleep(1000)
        Thread.currentThread().name
    }
    resultList.forEach { println(it) }
}

@Test
fun mapMultithreadingWithReturn() {
    val resultList = (1..10).mapMultithreading {
        Thread.sleep(1000)
        return@mapMultithreading Thread.currentThread().name
    }
    resultList.forEach { println(it) }
}

Getting started

<dependency>
  <groupId>me.kagura</groupId>
  <artifactId>harrier</artifactId>
  <version>1.3</version>
</dependency>

About

Simpler use of multithreading in Kotlin

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages