-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add kv get ext, fix runtime termination
- Loading branch information
1 parent
766744b
commit d143f31
Showing
31 changed files
with
635 additions
and
276 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { op_rivet_kv_get, op_rivet_kv_get_batch } from "ext:core/ops"; | ||
|
||
async function get(key, options) { | ||
return (await op_rivet_kv_get(key, options)) ?? undefined; | ||
} | ||
|
||
async function getBatch(keys, options) { | ||
return (await op_rivet_kv_get_batch(keys, options)) ?? undefined; | ||
} | ||
|
||
export { get, getBatch }; |
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import * as kv from "ext:rivet_kv/40_rivet_kv.js"; | ||
|
||
const rivetNs = { | ||
kv: { | ||
get: kv.get, | ||
getBatch: kv.getBatch, | ||
}, | ||
}; | ||
|
||
export { rivetNs }; |
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { core, primordials } from "ext:core/mod.js"; | ||
import { rivetNs } from "ext:rivet_runtime/90_rivet_ns.js"; | ||
const { ObjectDefineProperty } = primordials; | ||
|
||
ObjectDefineProperty(globalThis, "Rivet", core.propReadOnly(rivetNs)); |
Oops, something went wrong.