Skip to content

Commit bdfc14a

Browse files
committed
refactor: RSP -> rRPC
1 parent ea9e857 commit bdfc14a

File tree

10 files changed

+63
-71
lines changed

10 files changed

+63
-71
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
## RSP Documentation
2-
This repository contains documentation for the RSP framework written with Writerside. Link for documentation – https://rsp.timemates.org
1+
## rRPC Documentation
2+
This repository contains documentation for the rRPC framework written with Writerside. Link for documentation – https://rsp.timemates.org

Writerside/in.tree

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
SYSTEM "https://resources.jetbrains.com/writerside/1.0/product-profile.dtd">
44

55
<instance-profile id="in"
6-
name="RSP Documentation"
6+
name="rRPC Documentation"
77
start-page="Section-Starting-Page.topic">
88

99
<toc-element topic="Section-Starting-Page.topic"/>

Writerside/topics/Compatibility-with-ProtoBuf.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,6 @@ Our implementation of ProtoBuf serialization supports a subset of ProtoBuf featu
4343
7. **Generated Protos**:
4444
- Protos generated from `.proto` files are supported similarly to user-defined protos.
4545

46-
For features not supported or additional requirements, please [open an issue](https://github.com/timemates/rsp/issues/new/choose) to discuss potential support or contributions. This will help us understand and potentially address your use cases.
46+
For features not supported or additional requirements, please [open an issue](https://github.com/timemates/rrpc/issues/new/choose) to discuss potential support or contributions. This will help us understand and potentially address your use cases.
4747

4848
You may also want to learn more about options and how they're handled [here](ProtoBuf-Options.md).

Writerside/topics/Getting-started.md

Lines changed: 35 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# Getting started
22

3-
So you decided to go with RSP, let's make it quick. What do you need?
3+
So you decided to go with rRPC, let's make it quick. What do you need?
44

55
<warning>
6-
RSP is still under development, backward compatibility for communication model is not guaranteed until 1.0. For now,
6+
rRPC is still under development, backward compatibility for communication model is not guaranteed until 1.0. For now,
77
existing API is more likely to be as-is, but we need more feedback.
88
</warning>
99

@@ -13,20 +13,20 @@ First of all, you need a gradle plugin and the following dependencies:
1313

1414
```Kotlin
1515
plugins {
16-
id("org.timemates.rsp") version ("%lib-version%")
16+
id("org.timemates.rrpc") version ("%lib-version%")
1717
}
1818

1919
// ...
2020

2121
dependencies {
2222
// for server (jvm, js, native)
23-
commonMainImplementation("org.timemates.rsp:server-core:$version")
23+
commonMainImplementation("org.timemates.rrpc:server-core:$version")
2424

2525
// for client (jvm, js, native)
26-
commonMainImplementation("org.timemates.rsp:client-core:$version")
26+
commonMainImplementation("org.timemates.rrpc:client-core:$version")
2727

2828
// for server & client (jvm, js, native)
29-
commonMainImplementation("org.timemates.rsp:common-core:$version")
29+
commonMainImplementation("org.timemates.rrpc:common-core:$version")
3030
}
3131
```
3232

@@ -35,50 +35,42 @@ for [`rsocket-kotlin`](https://github.com/rsocket/rsocket-kotlin?tab=readme-ov-f
3535

3636
## Initialization
3737

38-
RSP generates code depending on the schema you specify in `.proto` files,
38+
rRPC generates code depending on the schema you specify in `.proto` files,
3939
similar to gRPC. You can learn more about protobuf [here](https://protobuf.dev/).
4040

4141
### Gradle Plugin
4242

43-
Let's start with configuring RSP gradle plugin:
43+
Let's start with configuring rRPC gradle plugin:
4444

4545
```Kotlin
46-
rsp {
46+
rrpc {
4747
// you might need to specify your main
4848
// source set (if its name is not commonMain / main)
4949
targetSourceSet = "commonMain"
5050

51-
profile {
52-
// enables code-generation for client
53-
client = true
54-
55-
// enables code-generation for client
56-
server = true
57-
}
58-
59-
paths {
60-
// folder with .proto schema files
61-
protoSources = "src/commonMain/proto"
62-
63-
// folder where generated code will be put
64-
generationOutput = "generated/rsp/src/commonMain"
65-
}
51+
// folder with .proto schema files (it may have multiple sources)
52+
protoSources.add("src/commonMain/proto")
6653

54+
// global options
6755
options {
68-
// indicates what builder types should be generated
69-
// CLASSIC – means plain java builder, mainly for compatibility
70-
// with Java
71-
builderTypes = setOf(
72-
MessageBuilderType.CLASSIC,
73-
MessageBuilderType.DSL,
74-
)
56+
permitPackageCycles = true
57+
}
58+
59+
configurations {
60+
kotlin {
61+
// kotlin-specific options
62+
options {
63+
generateServer = true
64+
generateClient = true
7565

76-
// if java is specified, it'll generate bridge for java
77-
// for now, it's not supported, but will be soon.
78-
targetLanguages = setOf(
79-
TargetLanguage.JAVA,
80-
TargetLanguage.KOTLIN,
81-
)
66+
// folder where generated code will be put
67+
generationOutput = "generated/rrpc/src/commonMain"
68+
}
69+
}
70+
71+
// or other languages (configurations)
72+
typescript {/* ... */}
73+
getByName("php") {/* ... */}
8274
}
8375
}
8476
```
@@ -102,7 +94,7 @@ service BarService {
10294
After you finished with your ProtoBuf definitions, you can use the following:
10395

10496
```Bash
105-
./gradlew :rsp:generateCode
97+
./gradlew :rrpc:generateCode
10698
```
10799

108100
### Server
@@ -127,7 +119,7 @@ And then you can use it whether with WebSockets or Sockets (via Ktor):
127119
<code-block lang="kotlin">
128120
fun Application.configureServer() {
129121
routing {
130-
rspEndpoint("/rsp") { // this: RSPModuleBuilder
122+
rrpcEndpoint("/rrpc") { // this: rRPCModuleBuilder
131123
service(BarServiceImpl())
132124
}
133125
}
@@ -139,7 +131,7 @@ And then you can use it whether with WebSockets or Sockets (via Ktor):
139131
<code-block lang="kotlin">
140132
val server: TcpServer = server.bind(transport) {
141133
RSocketRequestHandler {
142-
RSPModuleHandler(module).setup(this)
134+
rRPCModuleHandler(module).setup(this)
143135
}
144136
}
145137
server.handlerJob.join() //wait for server to finish
@@ -150,7 +142,7 @@ And then you can use it whether with WebSockets or Sockets (via Ktor):
150142
### Client
151143
For client, you simply initialize the class with the name of service + 'Client':
152144
```Kotlin
153-
val configuration = RSPClientConfig {
145+
val configuration = rRPCClientConfig {
154146
// assume we have a rsocket client instance
155147
// for obtaining a right one, please refer to the
156148
// rsocket-kotlin documentation.
@@ -165,6 +157,6 @@ All other things, like ability to reconnect automatically, you can find
165157
at [the official documentation](https://github.com/rsocket/rsocket-kotlin/blob/master/README.md).
166158

167159
<seealso>
168-
<a href="" type="start" summary="Install and start quickly with RSP">Getting started</a>
169-
<a href="" type="idea" summary="The idea and motivation behind RSP development">Why RSP?</a>
160+
<a href="" type="start" summary="Install and start quickly with rRPC">Getting started</a>
161+
<a href="" type="idea" summary="The idea and motivation behind rRPC development">Why rRPC?</a>
170162
</seealso>

Writerside/topics/Implementation.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Implementation Details
2-
If you're interested, how RSP works internally, but don't want to browse code, this section is for you.
2+
If you're interested, how rRPC works internally, but don't want to browse code, this section is for you.
33

44
## Metadata
55
As you already know, code is generated and then serialized using ProtoBuf. In RSocket requests, there's two parts that
@@ -40,7 +40,7 @@ For now, we support only Request-Response, Request-Stream and Request-Channel:
4040
| `rpc(stream T) return (stream R)` | Request-Channel |
4141

4242
Client-only streaming is not supported by transport (RSocket), so we don't support it either. We may support other
43-
request types by annotation type called `Ack`, here's [an issue](https://github.com/timemates/rsp/issues/9) to discuss.
43+
request types by annotation type called `Ack`, here's [an issue](https://github.com/timemates/rrpc/issues/9) to discuss.
4444

4545

4646
___________________________________

Writerside/topics/Instances.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ To provide your instance, just simply add it into your client / server configura
3939
<tabs>
4040
<tab title="Server">
4141
<code-block lang="kotlin">
42-
val module = RSPModule { // this: RSPModuleBuilder
42+
val module = rRPCModule { // this: rRPCModuleBuilder
4343
// services and other ...
4444
instances {
4545
register(MyInstance())
@@ -49,7 +49,7 @@ To provide your instance, just simply add it into your client / server configura
4949
</tab>
5050
<tab title="Client">
5151
<code-block lang="kotlin">
52-
val configuration = RSPClientConfig {
52+
val configuration = rRPCClientConfig {
5353
instances {
5454
register(MyInstance())
5555
}

Writerside/topics/Overview.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# Overview
22

3-
## What is RSP?
3+
## What is rRPC?
44

5-
RSP abbreviation stands for RSocket + ProtoBuf. This framework is designed to expose APIs as RPC (Remote Procedure Call)
6-
Services, enabling the creation of gRPC-like services directly from `.proto` files through code generation. RSP provides
5+
rRPC abbreviation stands for RSocket + ProtoBuf. This framework is designed to expose APIs as RPC (Remote Procedure Call)
6+
Services, enabling the creation of gRPC-like services directly from `.proto` files through code generation. rRPC provides
77
essential core components for both server and client-side development, making it easier to build scalable and efficient
88
RPC services.
99

@@ -17,21 +17,21 @@ although easier than managing entirely separate codebases, still presents challe
1717
Additionally, gRPC has several limitations, especially in web environments where it lacks support for bidirectional
1818
streaming. This limitation complicates the development process when full-duplex communication is needed.
1919

20-
RSP, on the other hand, is designed with simplicity in mind. Unlike gRPC, it does not require inventing new
20+
rRPC, on the other hand, is designed with simplicity in mind. Unlike gRPC, it does not require inventing new
2121
communication mechanisms or dealing with complex request schemas. It reuses existing communication model (RSocket), what
2222
makes it easier in adopting and supporting.Developers can even write clients using plain RSocket and Protobuf
2323
serialization libraries, making the framework more accessible and easier to implement.
2424

25-
## Why Choose RSP?
25+
## Why Choose rRPC?
2626

27-
The primary goal of RSP is to support a wide range of platforms and languages. Currently, the framework supports
27+
The primary goal of rRPC is to support a wide range of platforms and languages. Currently, the framework supports
2828
Kotlin (at the moment of prototyping, for convenience), with plans to extend support to Java (via a bridge), JavaScript,
29-
and Python in the near future. The RSP team is actively seeking feedback before the 1.0.0 release to refine the
29+
and Python in the near future. The rRPC team is actively seeking feedback before the 1.0.0 release to refine the
3030
framework's mental model and deliver a stable, user-friendly solution.
3131

3232
## Why Protobuf?
3333

34-
RSP is tightly integrated with Protobuf for serialization. We believe it's the most efficient in terms of compactness
34+
rRPC is tightly integrated with Protobuf for serialization. We believe it's the most efficient in terms of compactness
3535
and versioning for now. In addition, it's one of the most popular formats. While supporting other serialization
3636
mechanisms could be
3737
beneficial, the team believes that sticking with Protobuf ensures better compatibility and understanding across

Writerside/topics/ProtoBuf-Options.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# ProtoBuf Options Support
22

3-
The RSP code-generation supports ProtoBuf options on service and method levels.
3+
The rRPC code-generation supports ProtoBuf options on service and method levels.
44

55
<note>
66
For now, option's retention is not supported. The same applies to the file-level options or

Writerside/topics/Request-Response-Interceptors.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Request/Response Interceptors
22

3-
In the RSP framework, interceptors are a powerful mechanism that allows you to modify or augment the behavior of request
3+
In the rRPC framework, interceptors are a powerful mechanism that allows you to modify or augment the behavior of request
44
processing in a modular and reusable manner. Interceptors can be applied both to requests (input) and responses (output).
55
They operate on the `InterceptorContext`, which carries data, metadata, options, and instances related to the
66
request or response.
@@ -95,7 +95,7 @@ public class SimpleLoggingResponseInterceptor : ResponseInterceptor {
9595
```
9696

9797
## Registering interceptors
98-
To register your interceptor, just add it to your RSPClientConfig / RSPModule:
98+
To register your interceptor, just add it to your rRPCClientConfig / rRPCModule:
9999
<warning>
100100
The order of interceptors is important – it's applied strictly by how they're added. If you have some kind of
101101
exception handler or logging mechanism, ensure that you have it as a last one.
@@ -104,7 +104,7 @@ To register your interceptor, just add it to your RSPClientConfig / RSPModule:
104104
<tabs>
105105
<tab title="Server">
106106
<code-block lang="kotlin">
107-
val module = RSPModule { // this: RSPModuleBuilder
107+
val module = rRPCModule { // this: rRPCModuleBuilder
108108
// services and other ...
109109
requestInterceptor(MyRequestInterceptor())
110110
responseInterceptor(MyRequestInterceptor())
@@ -113,7 +113,7 @@ To register your interceptor, just add it to your RSPClientConfig / RSPModule:
113113
</tab>
114114
<tab title="Client">
115115
<code-block lang="kotlin">
116-
val configuration = RSPClientConfig {
116+
val configuration = rRPCClientConfig {
117117
requestInterceptor(MyRequestInterceptor())
118118
responseInterceptor(MyRequestInterceptor())
119119
}

Writerside/topics/Section-Starting-Page.topic

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
SYSTEM "https://resources.jetbrains.com/writerside/1.0/xhtml-entities.dtd">
44
<topic xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
55
xsi:noNamespaceSchemaLocation="https://resources.jetbrains.com/writerside/1.0/topic.v2.xsd"
6-
title="RSP" id="Section-Starting-Page">
6+
title="rRPC" id="Section-Starting-Page">
77

88
<!-- A section combines multiple topics dedicated to a specific subject.
99
Add a starting page to provide an overview of the topics in the section.
@@ -16,26 +16,26 @@
1616
For other groups, try to keep the number between 2 and 6, but you can add more if necessary.-->
1717

1818
<section-starting-page>
19-
<title>RSP Documentation</title>
19+
<title>rRPC Documentation</title>
2020
<description>
21-
These topics will help you get started with RSP.
21+
These topics will help you get started with rRPC.
2222
</description>
2323

2424
<!-- Add up to 2 topics that you want to promote. Use the "type" attribute to select an icon. -->
2525
<spotlight>
26-
<a href="Overview.md" type="idea" summary="The idea and motivation behind RSP development">Overview</a>
27-
<a href="Getting-started.md" type="start" summary="Install and start quickly with RSP">Getting started</a>
26+
<a href="Overview.md" type="idea" summary="The idea and motivation behind rRPC development">Overview</a>
27+
<a href="Getting-started.md" type="start" summary="Install and start quickly with rRPC">Getting started</a>
2828
</spotlight>
2929

3030
<primary>
3131
<title>FAQ</title>
3232
<a href="Compatibility-with-ProtoBuf.md" summary="Check what features of ProtoBuf is supported and which is not">Compatibility with Protobuf</a>
33-
<a href="Plans.md" summary="Our near-future plans for RSP">Plans</a>
33+
<a href="Plans.md" summary="Our near-future plans for rRPC">Plans</a>
3434
</primary>
3535

3636
<secondary>
3737
<title>Explore advanced stuff</title>
38-
<a href="Implementation.md" summary="Learn more about how RSP is built internally">Implementation Details</a>
38+
<a href="Implementation.md" summary="Learn more about how rRPC is built internally">Implementation Details</a>
3939
</secondary>
4040

4141
<!-- &lt;!&ndash; Optionally add additional cards and links to topics that are not in this section but may be relevant. &ndash;&gt;-->

0 commit comments

Comments
 (0)