Skip to content

Commit 0fd613b

Browse files
committed
delete domain module, and simplify APIs
1 parent aaac500 commit 0fd613b

File tree

16 files changed

+16
-104
lines changed

16 files changed

+16
-104
lines changed

core/build.gradle.kts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import org.springframework.boot.gradle.tasks.bundling.BootJar
22

33
dependencies {
4-
implementation(project(":domain"))
54
implementation("io.projectreactor:reactor-core")
65
implementation("io.micrometer:micrometer-core")
76
implementation("org.springframework.boot:spring-boot")
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
package info.log.core.client
22

3-
import info.log.domain.Person
43
import org.springframework.web.service.annotation.GetExchange
54

65
interface HelloClient {
76
@GetExchange("/hello")
8-
fun hello(): List<Person>
7+
fun hello()
98
}

domain/build.gradle.kts

Lines changed: 0 additions & 9 deletions
This file was deleted.

domain/src/main/kotlin/info/log/domain/Person.kt

Lines changed: 0 additions & 44 deletions
This file was deleted.

domain/src/main/resources/application.yml

Lines changed: 0 additions & 9 deletions
This file was deleted.

kotlin-coroutine-api/build.gradle.kts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
dependencies {
2-
implementation(project(":domain"))
32
implementation(project(":core"))
43
implementation("org.springframework.boot:spring-boot-starter-webflux")
54
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-reactor")
Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,17 @@
11
package info.log.kotlincoroutineapi.web
22

3-
import info.log.domain.Person
4-
import kotlinx.coroutines.flow.Flow
5-
import kotlinx.coroutines.reactive.asFlow
6-
import org.slf4j.Logger
7-
import org.slf4j.LoggerFactory
3+
import kotlinx.coroutines.reactive.awaitSingle
84
import org.springframework.web.bind.annotation.GetMapping
95
import org.springframework.web.bind.annotation.RestController
6+
import reactor.core.publisher.Mono
7+
import java.time.Duration.ofMillis
108

119

1210
@RestController
1311
class HelloController {
14-
val log: Logger = LoggerFactory.getLogger(this.javaClass)
15-
1612
@GetMapping("/hello")
17-
suspend fun hello(): Flow<Person> {
18-
return Person.createPeopleFluxRandomly().asFlow()
13+
suspend fun hello(): Long {
14+
return Mono.delay(ofMillis(100))
15+
.awaitSingle()
1916
}
2017
}

platform-thread-api/build.gradle.kts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
dependencies {
2-
implementation(project(":domain"))
32
implementation(project(":core"))
43
implementation("org.springframework.boot:spring-boot-starter-web")
54
implementation(kotlin("stdlib-jdk8"))
Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,13 @@
11
package info.log.platformthreadapi.web
22

3-
import info.log.domain.Person
4-
import org.slf4j.Logger
5-
import org.slf4j.LoggerFactory
63
import org.springframework.web.bind.annotation.GetMapping
74
import org.springframework.web.bind.annotation.RestController
85

96

107
@RestController
118
class HelloController {
12-
val log: Logger = LoggerFactory.getLogger(this.javaClass)
13-
149
@GetMapping("/hello")
15-
fun hello(): List<Person> {
16-
return Person.createPeopleListRandomly()
10+
fun hello() {
11+
Thread.sleep(100)
1712
}
1813
}

platform-thread-api/src/main/resources/application.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ server:
22
port: 10000
33
tomcat:
44
threads:
5-
max: 500
5+
max: 2000
66
min-spare: 10
77
max-connections: 8192
88
accept-count: 100

0 commit comments

Comments
 (0)