You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.adoc
+22-25
Original file line number
Diff line number
Diff line change
@@ -7,12 +7,10 @@ Simple native RPC with high order functions support.
7
7
== Service as a library
8
8
9
9
.λRPC makes multi-process communication smooth enough to recognize remote service like a common library. It is powered by two main ideas:
10
-
* λRPC does not use standalone declarations (https://en.wikipedia.org/wiki/Interface_description_language[IDL])
11
-
and code generation (so λRPC declarations are native for the user's code).
12
-
Instead it allows working with library-specific data structures and default or custom serializers.
10
+
* λRPC does not use standalone declarations (https://en.wikipedia.org/wiki/Interface_description_language[IDL]) and code generation (so λRPC declarations are native for the user's code).
11
+
Instead, it allows working with library-specific data structures and default or custom serializers.
13
12
* λRPC functions can receive and return other functions as first-class objects.
14
-
Passed lambda will be executed on the client-side, so it can easily capture the state (even mutable)
15
-
and be "sent" to the other language's process.
13
+
Passed lambda will be executed on the client-side, so it can easily capture the state (even mutable) and be "sent" to the other language's process.
16
14
17
15
== Example
18
16
@@ -74,7 +72,7 @@ fun main() = runBlocking(serviceDispatcher) {
74
72
val rawModel = Model(...)
75
73
// Bind dataloader with dataEndpoint, so mlservice will communicate directly
76
74
// with the dataservice on the dataEndpoint without client in the middle
77
-
val boundLoader = bf(dataloader)
75
+
val boundLoader = dataloader.toBound()
78
76
val model = fit(rawModel, boundLoader) { epoch, metric ->
79
77
// Lambda will be executed on the client site -- the λRPC magic
* Interactive computations: computing function receives closure as a parameter and calls it periodically, providing computation status information and receiving further directives.
125
123
* Security:
126
124
** Send closures operating on the sensitive data instead of the data itself.
127
-
** Provide computational resources as a library of functions that are parametrized by client lambdas instead of
128
-
receiving the client's code and executing it.
129
-
* Choose dynamically computation location: compute something that uses a large amount of data on a client or send data to the server and
130
-
compute there.
125
+
** Provide computational resources as a library of functions that are parametrized by client lambdas instead of receiving the client's code and executing it.
126
+
* Choose dynamically computation location: compute something that uses a large amount of data on a client or send data to the server and compute there.
131
127
* Load balancing: once a task is finished, request new via client's lambda.
132
128
* Stateful streaming computations: nodes provide their lambdas for a mapper.
133
129
@@ -143,53 +139,54 @@ Then λRPC provides efficient communication with the corresponding backend part.
143
139
144
140
== Getting started
145
141
146
-
.Run both `:detekt` and `:test` tasks
142
+
.Build and run fast tests and checks
147
143
[source,bash]
148
144
----
149
-
$ ./gradlew :lambdarpc:check
145
+
$ ./gradlew build
150
146
----
151
147
152
148
.Run stress tests
153
149
[source,bash]
154
150
----
155
-
$ ./gradlew :lambdarpc:slow
151
+
$ ./gradlew :lambdarpc-core:slow
156
152
----
157
153
158
154
.Generate documentation
159
155
[source,bash]
160
156
----
161
-
$ ./gradlew :lambdarpc:dokkaHtml
162
-
$ cd ./lambdarpc/build/dokka/html
157
+
$ ./gradlew :lambdarpc-core:dokkaHtml
158
+
$ cd ./lambdarpc-core/build/dokka/html
163
159
----
164
160
165
161
=== Repository organization
166
162
167
163
.examples
168
-
* `ml` -- readme example.
164
+
* `interactive_ml` -- readme example.
165
+
169
166
[sources,bash]
170
167
----
171
168
$ cd LambdaRPC.kt
172
169
$ ./gradlew :examples:ml.dataservice
173
170
$ ./gradlew :examples:ml.mlservice
174
171
$ ./gradlew :examples:ml.client
175
172
----
176
-
* `lazy` -- an interesting example that shows the possibility to build lazy
177
-
data processing pipelines using common λRPC functionality.
173
+
174
+
* `promise_pipeline` -- an interesting example that shows the possibility to build lazy data processing pipelines using common λRPC functionality.
175
+
178
176
[sources,bash]
179
177
----
180
178
$ cd LambdaRPC.kt
181
-
$ ./gradlew :examples:lazy.service --args=8090
182
-
$ ./gradlew :examples:lazy.service --args=8091
179
+
$ ./gradlew :examples:promise.service --args=8090
180
+
$ ./gradlew :examples:promise.service --args=8091
183
181
# Any number of services on different ports
184
-
$ ./gradlew :examples:lazy.client --args='8090 8091' # Ports of all services
182
+
$ ./gradlew :examples:promise.client --args='8090 8091' # Ports of all services
185
183
----
186
184
187
-
.lambdarpc
185
+
.lambdarpc-core
188
186
* `dsl` -- domain-specific language for λRPC library users.
189
-
* `exceptions` -- base λRPC exception classes.
190
187
* `functions` -- λRPC functions: backend and frontend parts.
191
-
* `coders` -- data coder (serializer) and function coder.
192
-
** λRPC provides some default data coders based on `kotlinx.serialization`, but users can also implement thier own.
188
+
* `coding` -- contains `Coder` definition, it is a thing that can serialize data and work with functions.
189
+
** λRPC provides some default data coders based on `kotlinx.serialization`, but users can also implement their own.
193
190
** Function encoding saves language closure as backend function to the registry with some `access name`.
194
191
Function decoding creates a frontend function that communicates with the corresponding backend function.
0 commit comments