Skip to content
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

Document ctx.clearAll() and ctx.stateKeys() #309

Merged
merged 1 commit into from
Mar 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions docs/services/sdk/state.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ import TabItem from '@theme/TabItem';
Restate offers durable storage of application state, with support for key-value state that can be retrieved, set, and cleared via its key.
Using this feature requires no additional setup.

## Listing state keys
To list all the keys that have entries in the state store for that invocation (and its keyed service instance),, do:

```
ctx.stateKeys();
```

## Retrieving state
To retrieve state in Restate, you can do the following:

Expand Down Expand Up @@ -126,3 +133,9 @@ Have a look at [the docs on retrieving state](/services/sdk/state#retrieving-sta

</TabItem>
</Tabs>

To delete all K/V state entries for the invocation (and its keyed service instance), do:

```
ctx.clearAll();
```
Loading