Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
c9057c2
Started doing something
slinkydeveloper Jan 21, 2025
db27294
Progress
slinkydeveloper Jan 23, 2025
cab4099
Progress
slinkydeveloper Jan 24, 2025
387cb4d
Progress
slinkydeveloper Jan 27, 2025
8e7c1c8
Progress
slinkydeveloper Jan 31, 2025
1aadf52
WIP
slinkydeveloper Feb 3, 2025
7090524
WIP
slinkydeveloper Feb 3, 2025
a15bafb
WIP
slinkydeveloper Feb 3, 2025
e462f70
WIP
slinkydeveloper Feb 3, 2025
6889871
WIP
slinkydeveloper Feb 3, 2025
d5a4ed8
WIP
slinkydeveloper Feb 3, 2025
d3d13f7
WIP
slinkydeveloper Feb 3, 2025
ab602d2
WIP
slinkydeveloper Feb 7, 2025
021d37c
WIP
slinkydeveloper Feb 7, 2025
e30a24b
WIP
slinkydeveloper Feb 7, 2025
54d6f8e
WIP
slinkydeveloper Feb 7, 2025
550f60e
WIP
slinkydeveloper Feb 10, 2025
0fe67d0
WIP
slinkydeveloper Feb 10, 2025
2752569
WIP
slinkydeveloper Feb 10, 2025
3a95a01
WIP
slinkydeveloper Feb 10, 2025
d9db180
WIP
slinkydeveloper Feb 10, 2025
2ec0522
Still hunting issues :(
slinkydeveloper Feb 11, 2025
a367f68
Fixed few important concurrency issues, now everything looks good!
slinkydeveloper Feb 12, 2025
f4eb2e9
Gradle check is finally passing!
slinkydeveloper Feb 12, 2025
336d8b0
Name on timer
slinkydeveloper Feb 12, 2025
e1e75c9
spotless apply
slinkydeveloper Feb 12, 2025
57746ce
spotless apply
slinkydeveloper Feb 12, 2025
b06f5e7
Sort out send options/call options
slinkydeveloper Feb 12, 2025
224d4b9
Fix Kotlin's send
slinkydeveloper Feb 12, 2025
0a0a92c
Implicit cancellation
slinkydeveloper Feb 12, 2025
ca37d0c
Funny issue
slinkydeveloper Feb 12, 2025
889c2b0
WIP sorted out other stuff
slinkydeveloper Feb 13, 2025
0e512b6
WIP sorted out other stuff
slinkydeveloper Feb 14, 2025
f140ddb
The new ingress client is finished!
slinkydeveloper Feb 17, 2025
ce9def9
Just missing kotlin generator now!
slinkydeveloper Feb 17, 2025
b944bc4
Ok we're good!
slinkydeveloper Feb 17, 2025
c059f63
Javadocs fix
slinkydeveloper Feb 17, 2025
c78d2a0
Little kotlin fix
slinkydeveloper Feb 17, 2025
72e572f
Bumps
slinkydeveloper Feb 17, 2025
ffa41fb
Try to figure out how to shade protobuf (doesn't work yet...)
slinkydeveloper Feb 17, 2025
c17c8ab
Maybe this actually works
slinkydeveloper Feb 18, 2025
d884ec7
Moved all the unit tests in sdk-core. It's a bit messy, but it works …
slinkydeveloper Feb 18, 2025
428545a
Cherry on top
slinkydeveloper Feb 18, 2025
de5db4b
Lil fix for jib
slinkydeveloper Feb 18, 2025
a506ed6
Add cancel invocation/attach invocation/get invocation output
slinkydeveloper Feb 18, 2025
0f434b3
Remove serde-protobuf, Remove buf files
slinkydeveloper Feb 19, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 0 additions & 2 deletions buf.lock

This file was deleted.

8 changes: 0 additions & 8 deletions buf.yaml

This file was deleted.

4 changes: 3 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import com.github.jk1.license.render.ReportRenderer

plugins {
alias(libs.plugins.dependency.license.report)
alias(libs.plugins.nexus.publish)
Expand Down Expand Up @@ -45,7 +47,7 @@ allprojects {
tasks.named("check") { dependsOn("checkLicense") }

licenseReport {
renderers = arrayOf(com.github.jk1.license.render.CsvReportRenderer())
renderers = arrayOf<ReportRenderer>(com.github.jk1.license.render.CsvReportRenderer())

excludeBoms = true

Expand Down
61 changes: 59 additions & 2 deletions buildSrc/src/main/kotlin/library-publishing-conventions.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,68 @@ project.afterEvaluate {
publishing {
publications {
create<MavenPublication>("maven") {
afterEvaluate {
val shadowJar = tasks.findByName("shadowJar")
if (shadowJar == null) {
from(components["java"])
}
else {
apply(plugin = "com.gradleup.shadow")

from(components["shadow"])
artifact(tasks["sourcesJar"]!!)
artifact(tasks["javadocJar"]!!)

afterEvaluate {
// Fix for avoiding inclusion of runtime dependencies marked as 'shadow' in MANIFEST Class-Path.
// https://github.com/johnrengelman/shadow/issues/324
pom.withXml {
val rootNode = asElement()
val doc = rootNode.ownerDocument

val dependenciesNode =
if (rootNode.getElementsByTagName("dependencies").length != 0) {
rootNode.getElementsByTagName("dependencies").item(0)
} else {
rootNode.appendChild(
doc.createElement("dependencies")
)
}

project.configurations["shade"].allDependencies.forEach { dep ->
dependenciesNode.appendChild(
doc.createElement("dependency").apply {
appendChild(
doc.createElement("groupId").apply {
textContent = dep.group
}
)
appendChild(
doc.createElement("artifactId").apply {
textContent = dep.name
}
)
appendChild(
doc.createElement("version").apply {
textContent = dep.version
}
)
appendChild(
doc.createElement("scope").apply {
textContent = "runtime"
}
)
}
)
}
}
}
}
}

groupId = "dev.restate"
artifactId = project.name

from(components["java"])

pom {
name = "Restate SDK :: ${project.name}"
description = project.description!!
Expand Down
9 changes: 0 additions & 9 deletions buildSrc/src/main/kotlin/test-jar-conventions.gradle.kts

This file was deleted.

11 changes: 11 additions & 0 deletions client-kotlin/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
plugins {
`kotlin-conventions`
`library-publishing-conventions`
}

description = "Restate Client to interact with services from within other Kotlin applications"

dependencies {
api(project(":client"))
implementation(libs.kotlinx.coroutines.core)
}
99 changes: 99 additions & 0 deletions client-kotlin/src/main/kotlin/dev/restate/client/kotlin/ingress.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
// Copyright (c) 2023 - Restate Software, Inc., Restate GmbH
//
// This file is part of the Restate Java SDK,
// which is released under the MIT license.
//
// You can find a copy of the license in file LICENSE in the root
// directory of this repository or package, or at
// https://github.com/restatedev/sdk-java/blob/main/LICENSE
package dev.restate.client.kotlin

import dev.restate.client.Client
import dev.restate.client.ClientRequestOptions
import dev.restate.client.ClientResponse
import dev.restate.client.SendResponse
import dev.restate.common.Output
import dev.restate.common.Request
import dev.restate.serde.Serde
import kotlinx.coroutines.future.await

// Extension methods for the Client

fun clientRequestOptions(init: ClientRequestOptions.Builder.() -> Unit): ClientRequestOptions {
val builder = ClientRequestOptions.builder()
builder.init()
return builder.build()
}

suspend fun <Req, Res> Client.callSuspend(request: Request<Req, Res>): ClientResponse<Res> {
return this.callAsync(request).await()
}

suspend fun <Req, Res> Client.callSuspend(
requestBuilder: Request.Builder<Req, Res>
): ClientResponse<Res> {
return this.callAsync(requestBuilder).await()
}

suspend fun <Req, Res> Client.sendSuspend(
request: Request<Req, Res>
): ClientResponse<SendResponse<Res>> {
return this.sendAsync(request).await()
}

suspend fun <Req, Res> Client.sendSuspend(
request: Request.Builder<Req, Res>
): ClientResponse<SendResponse<Res>> {
return this.sendSuspend(request.build())
}

suspend fun <T : Any> Client.AwakeableHandle.resolveSuspend(
serde: Serde<T>,
payload: T,
options: ClientRequestOptions = ClientRequestOptions.DEFAULT
): ClientResponse<Void> {
return this.resolveAsync(serde, payload, options).await()
}

suspend fun Client.AwakeableHandle.rejectSuspend(
reason: String,
options: ClientRequestOptions = ClientRequestOptions.DEFAULT
): ClientResponse<Void> {
return this.rejectAsync(reason, options).await()
}

suspend fun <T> Client.InvocationHandle<T>.attachSuspend(
options: ClientRequestOptions = ClientRequestOptions.DEFAULT
): ClientResponse<T> {
return this.attachAsync(options).await()
}

suspend fun <T : Any?> Client.InvocationHandle<T>.getOutputSuspend(
options: ClientRequestOptions = ClientRequestOptions.DEFAULT
): ClientResponse<Output<T>> {
return this.getOutputAsync(options).await()
}

suspend fun <T> Client.IdempotentInvocationHandle<T>.attachSuspend(
options: ClientRequestOptions = ClientRequestOptions.DEFAULT
): ClientResponse<T> {
return this.attachAsync(options).await()
}

suspend fun <T> Client.IdempotentInvocationHandle<T>.getOutputSuspend(
options: ClientRequestOptions = ClientRequestOptions.DEFAULT
): ClientResponse<Output<T>> {
return this.getOutputAsync(options).await()
}

suspend fun <T> Client.WorkflowHandle<T>.attachSuspend(
options: ClientRequestOptions = ClientRequestOptions.DEFAULT
): ClientResponse<T> {
return this.attachAsync(options).await()
}

suspend fun <T> Client.WorkflowHandle<T>.getOutputSuspend(
options: ClientRequestOptions = ClientRequestOptions.DEFAULT
): ClientResponse<Output<T>> {
return this.getOutputAsync(options).await()
}
20 changes: 20 additions & 0 deletions client/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
plugins {
`java-library`
`java-conventions`
`kotlin-conventions`
`library-publishing-conventions`
}

description = "Restate Client to interact with services from within other Java applications"

dependencies {
compileOnly(libs.jspecify)

api(project(":common"))

implementation(libs.jackson.core)
implementation(libs.log4j.api)

testImplementation(libs.junit.jupiter)
testImplementation(libs.assertj)
}
Loading