-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rename the ingress client and the connect method (#336)
- Loading branch information
1 parent
ff15028
commit 0e1434a
Showing
12 changed files
with
68 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,12 +15,12 @@ object {{generatedClassSimpleName}} { | |
return ContextClient(ctx{{#isKeyed}}, key{{/isKeyed}}) | ||
} | ||
|
||
fun fromIngress(ingressClient: dev.restate.sdk.client.IngressClient{{#isKeyed}}, key: String{{/isKeyed}}): IngressClient { | ||
return IngressClient(ingressClient{{#isKeyed}}, key{{/isKeyed}}); | ||
fun fromClient(client: dev.restate.sdk.client.Client{{#isKeyed}}, key: String{{/isKeyed}}): IngressClient { | ||
return IngressClient(client{{#isKeyed}}, key{{/isKeyed}}); | ||
} | ||
|
||
fun fromIngress(baseUri: String{{#isKeyed}}, key: String{{/isKeyed}}): IngressClient { | ||
return IngressClient(dev.restate.sdk.client.IngressClient.defaultClient(baseUri){{#isKeyed}}, key{{/isKeyed}}); | ||
fun connect(baseUri: String{{#isKeyed}}, key: String{{/isKeyed}}): IngressClient { | ||
return IngressClient(dev.restate.sdk.client.Client.connect(baseUri){{#isKeyed}}, key{{/isKeyed}}); | ||
} | ||
|
||
class ContextClient(private val ctx: Context{{#isKeyed}}, private val key: String{{/isKeyed}}){ | ||
|
@@ -49,18 +49,18 @@ object {{generatedClassSimpleName}} { | |
} | ||
} | ||
|
||
class IngressClient(private val ingressClient: dev.restate.sdk.client.IngressClient{{#isKeyed}}, private val key: String{{/isKeyed}}) { | ||
class IngressClient(private val client: dev.restate.sdk.client.Client{{#isKeyed}}, private val key: String{{/isKeyed}}) { | ||
|
||
{{#handlers}}{{#if isWorkflow}} | ||
fun workflowHandle(): dev.restate.sdk.client.IngressClient.WorkflowHandle<{{{boxedOutputFqcn}}}> { | ||
return this@IngressClient.ingressClient.workflowHandle( | ||
fun workflowHandle(): dev.restate.sdk.client.Client.WorkflowHandle<{{{boxedOutputFqcn}}}> { | ||
return this@IngressClient.client.workflowHandle( | ||
{{generatedClassSimpleNamePrefix}}Definitions.SERVICE_NAME, | ||
this.key, | ||
{{outputSerdeRef}}); | ||
} | ||
|
||
suspend fun submit({{^inputEmpty}}req: {{{inputFqcn}}}, {{/inputEmpty}}requestOptions: dev.restate.sdk.client.RequestOptions = dev.restate.sdk.client.RequestOptions.DEFAULT): dev.restate.sdk.client.SendResponse { | ||
return this@IngressClient.ingressClient.sendSuspend( | ||
return this@IngressClient.client.sendSuspend( | ||
{{{targetExpr this "this.key"}}}, | ||
{{inputSerdeRef}}, | ||
{{#if inputEmpty}}Unit{{else}}req{{/if}}, | ||
|
@@ -69,7 +69,7 @@ object {{generatedClassSimpleName}} { | |
} | ||
{{else}} | ||
suspend fun {{methodName}}({{^inputEmpty}}req: {{{inputFqcn}}}, {{/inputEmpty}}requestOptions: dev.restate.sdk.client.CallRequestOptions = dev.restate.sdk.client.CallRequestOptions.DEFAULT): {{{boxedOutputFqcn}}} { | ||
return this@IngressClient.ingressClient.callSuspend( | ||
return this@IngressClient.client.callSuspend( | ||
{{{targetExpr this "this.key"}}}, | ||
{{inputSerdeRef}}, | ||
{{outputSerdeRef}}, | ||
|
@@ -85,7 +85,7 @@ object {{generatedClassSimpleName}} { | |
inner class Send(private val delay: Duration) { | ||
{{#handlers}}{{^isWorkflow}} | ||
suspend fun {{methodName}}({{^inputEmpty}}req: {{{inputFqcn}}}, {{/inputEmpty}}requestOptions: dev.restate.sdk.client.CallRequestOptions = dev.restate.sdk.client.CallRequestOptions.DEFAULT): dev.restate.sdk.client.SendResponse { | ||
return this@IngressClient.ingressClient.sendSuspend( | ||
return this@IngressClient.client.sendSuspend( | ||
{{{targetExpr this "[email protected]"}}}, | ||
{{inputSerdeRef}}, | ||
{{#if inputEmpty}}Unit{{else}}req{{/if}}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.