@@ -6,7 +6,8 @@ import dev.restate.sdk.common.StateKey
6
6
import dev.restate.sdk.common.Serde
7
7
import dev.restate.sdk.common.Target
8
8
import kotlin.time.Duration
9
- import kotlinx.coroutines.future.await
9
+ import dev.restate.sdk.kotlin.callSuspend
10
+ import dev.restate.sdk.kotlin.sendSuspend
10
11
11
12
object {{ generatedClassSimpleName }} {
12
13
@@ -59,12 +60,12 @@ object {{generatedClassSimpleName}} {
59
60
60
61
{{ #handlers }}
61
62
suspend fun {{ name }} ({{ ^inputEmpty }} req: {{{ inputFqcn }}} , {{ /inputEmpty }} requestOptions: dev.restate.sdk.client.RequestOptions = dev.restate.sdk.client.RequestOptions.DEFAULT): {{{ boxedOutputFqcn }}} {
62
- return this.ingressClient.callAsync (
63
+ return this.ingressClient.callSuspend (
63
64
{{ #if isObject }} Target.virtualObject(COMPONENT_NAME, this.key, "{{ name }} "){{ else }} Target.service(COMPONENT_NAME, "{{ name }} "){{ /if }} ,
64
65
{{ inputSerdeFieldName }} ,
65
66
{{ outputSerdeFieldName }} ,
66
- {{ #if inputEmpty }} null {{ else }} req{{ /if }} ,
67
- requestOptions).await() ;
67
+ {{ #if inputEmpty }} Unit {{ else }} req{{ /if }} ,
68
+ requestOptions);
68
69
}{{ /handlers }}
69
70
70
71
fun send(): Send {
@@ -74,11 +75,11 @@ object {{generatedClassSimpleName}} {
74
75
inner class Send {
75
76
{{ #handlers }}
76
77
suspend fun {{ name }} ({{ ^inputEmpty }} req: {{{ inputFqcn }}} , {{ /inputEmpty }} requestOptions: dev.restate.sdk.client.RequestOptions = dev.restate.sdk.client.RequestOptions.DEFAULT): String {
77
- return this@IngressClient.ingressClient.sendAsync (
78
+ return this@IngressClient.ingressClient.sendSuspend (
78
79
{{ #if isObject }} Target.virtualObject(COMPONENT_NAME, this@IngressClient.key, "{{ name }} "){{ else }} Target.service(COMPONENT_NAME, "{{ name }} "){{ /if }} ,
79
80
{{ inputSerdeFieldName }} ,
80
- {{ #if inputEmpty }} null {{ else }} req{{ /if }} ,
81
- requestOptions).await() ;
81
+ {{ #if inputEmpty }} Unit {{ else }} req{{ /if }} ,
82
+ requestOptions);
82
83
}{{ /handlers }}
83
84
}
84
85
}
0 commit comments