Skip to content

Commit 8e58235

Browse files
committed
Updated README.md
1 parent 06b9295 commit 8e58235

File tree

1 file changed

+33
-22
lines changed

1 file changed

+33
-22
lines changed

README.md

Lines changed: 33 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -19,22 +19,16 @@ Build your RPC with already known language constructs and nothing more!
1919

2020
First, create your RPC service and define some methods:
2121
```kotlin
22-
import kotlinx.rpc.RemoteService
23-
import kotlinx.rpc.annotations.Rpc
24-
2522
@Rpc
26-
interface AwesomeService : RemoteService {
23+
interface AwesomeService {
2724
fun getNews(city: String): Flow<String>
2825

2926
suspend fun daysUntilStableRelease(): Int
3027
}
3128
```
3229
In your server code define how to respond by simply implementing the service:
3330
```kotlin
34-
class AwesomeServiceImpl(
35-
val parameters: AwesomeParameters,
36-
override val coroutineContext: CoroutineContext,
37-
) : AwesomeService {
31+
class AwesomeServiceImpl(val parameters: AwesomeParameters) : AwesomeService {
3832
override fun getNews(city: String): Flow<String> {
3933
return flow {
4034
emit("Today is 23 degrees!")
@@ -66,8 +60,8 @@ fun main() {
6660
}
6761
}
6862

69-
registerService<AwesomeService> { ctx ->
70-
AwesomeServiceImpl(AwesomeParameters(false, null), ctx)
63+
registerService<AwesomeService> {
64+
AwesomeServiceImpl(AwesomeParameters(false, null))
7165
}
7266
}
7367
}
@@ -90,10 +84,8 @@ val service = rpcClient.withService<AwesomeService>()
9084

9185
service.daysUntilStableRelease()
9286

93-
streamScoped {
94-
service.getNews("KotlinBurg").collect { article ->
95-
println(article)
96-
}
87+
service.getNews("KotlinBurg").collect { article ->
88+
println(article)
9789
}
9890
```
9991

@@ -106,6 +98,33 @@ Check out our [getting started guide](https://kotlin.github.io/kotlinx-rpc) for
10698
To ensure that all IDE features of our compiler plugin work properly on IntelliJ-based IDEs, install the
10799
[Kotlin External FIR Support](https://plugins.jetbrains.com/plugin/26480-kotlin-external-fir-support?noRedirect=true) plugin.
108100

101+
## Kotlin compatibility
102+
We support all stable Kotlin versions starting from 2.0.0:
103+
- 2.0.0, 2.0.10, 2.0.20, 2.0.21
104+
- 2.1.0, 2.1.10, 2.1.20, 2.1.21
105+
106+
For a full compatibility checklist,
107+
see [Versions](https://kotlin.github.io/kotlinx-rpc/versions.html).
108+
109+
## Supported Platforms
110+
111+
`kotlinx.rpc` is a KMP library, so we aim to support all available platforms.
112+
113+
However, we are also a multi-module library, meaning that some modules may not support some platforms.
114+
115+
Current high-level status:
116+
117+
| Subsystem | Supported Platforms |
118+
|-----------|--------------------------------------------|
119+
| Core | JVM, Native, JS, WasmJs, WasmWASI, Windows |
120+
| kRPC | JVM, Native, JS, WasmJs, Windows |
121+
| gRPC | JVM (in JVM-only projects) |
122+
123+
For more detailed module by module information,
124+
check out our [platform support table](https://kotlin.github.io/kotlinx-rpc/platforms.html).
125+
126+
For information about gRPC, see [gRPC Integration](#grpc-integration)
127+
109128
### Gradle plugins
110129

111130
`kotlinx.rpc` provides Gradle plugin `org.jetbrains.kotlinx.rpc.plugin`
@@ -174,14 +193,6 @@ For more information on gRPC usage,
174193
see the [official documentation](https://kotlin.github.io/kotlinx-rpc/grpc-configuration.html).
175194
For a working example, see the [sample gRPC project](/samples/grpc-app).
176195

177-
## Kotlin compatibility
178-
We support all stable Kotlin versions starting from 2.0.0:
179-
- 2.0.0, 2.0.10, 2.0.20, 2.0.21
180-
- 2.1.0, 2.1.10, 2.1.20, 2.1.21
181-
182-
For a full compatibility checklist,
183-
see [Versions](https://kotlin.github.io/kotlinx-rpc/versions.html).
184-
185196
## JetBrains Product
186197

187198
`kotlinx.rpc` is an official [JetBrains](https://jetbrains.com) product and is primarily developed by the team at JetBrains, with

0 commit comments

Comments
 (0)