Skip to content

Commit

Permalink
Suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
slinkydeveloper committed Jul 21, 2023
1 parent c8419f2 commit a48758a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions docs/service_contract.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ option (dev.restate.ext.service_type) = SINGLETON;

For keyed services, you're required to specify in every input message the field to use as key. To mark a field as key, annotate it with `dev.restate.ext.field`. Make sure that:

* There is only one key field.
* The field type is either a primitive or a message. Repeated field and maps are not supported.
* The field type is the same for every method input message of the same service.

Expand Down
2 changes: 1 addition & 1 deletion docs/service_type.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ To define the service type and key, check the [service contract](./service_contr

## Keyed service

Keyed services allow to shard state and workload by a user-defined key. Each key will have its own invocations queue and its own subset of the service state. There is at most one invocation per key, but there can be multiple invocations to the same service with different keys executing concurrently.
Keyed services allow to shard state and workload by a user-defined key. Each key will have its own invocations queue and its own state. There is at most one invocation per key, but there can be multiple invocations to the same service with different keys executing concurrently.

You can think of a keyed service as a class, and of a service instance as an object instance of that class. The key is the field that **uniquely** identifies that instance, and state entries are the other fields of that class.

Expand Down

0 comments on commit a48758a

Please sign in to comment.