-
Notifications
You must be signed in to change notification settings - Fork 11
DbosKotlinInternal class #267
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR introduces Kotlin-friendly wrappers for DBOS static methods to improve ergonomics for Kotlin developers. The changes leverage Kotlin language features like trailing lambda syntax, default parameters, and property accessors while maintaining compatibility with the underlying Java API.
Changes:
- Added
DbosKotlinInternal.ktwith top-level function wrappers for all DBOS static methods - Reordered parameters to enable trailing lambda syntax for workflow and step functions
- Added Kotlin plugin configuration to the build file
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| transact/src/main/kotlin/dev/dbos/transact/DBOSExtensions.kt | New file providing Kotlin-idiomatic wrappers around DBOS static methods with trailing lambda support and default parameters |
| transact/build.gradle.kts | Added Kotlin JVM plugin version 2.3.0 and compiler configuration for Java 17 target |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
kraftp
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To understand this better, how does it affect Java users? As a Kotlin user, how do I use this?
No effect on Java devs. For Kotlin devs, we expose top level functions instead of Update: you can kind of get a sense of how this will look from dbos-inc/dbos-demo-apps#394. That demo app however has a local DBOS Extensions kotlin file as opposed to one in the main dbos transact package that this PR adds. So the imports are different but the code is basically the same |
|
This looks harmless, maybe we merge it and see if it works easily in the demo then? |
I want to get 0.7 release out the door, then I agree |
Initial experiment for including a wrapper around the various
DBOS.*static methods to make them kotlin friendly. In particular:runStepandstartWorkflow, make the lambda the last parameter to take advantage of trailing lambda syntaxExceptionas Kotlin doesn't have checked exceptionsregisterWorkflowsinstanceNameandsendidempotencyKey)