Skip to content

Commit

Permalink
[WIP] Awakeable IDs following the new ID scheme
Browse files Browse the repository at this point in the history
  • Loading branch information
AhmedSoliman committed Jan 26, 2024
1 parent 318a5be commit 331365f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions sdk-core/src/main/java/dev/restate/sdk/core/Entries.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import java.util.function.Function;

final class Entries {
public static final String AWAKEABLE_IDENTIFIER_PREFIX = "prom_1";

private Entries() {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,8 @@ public void awakeable(SyscallCallback<Map.Entry<String, DeferredResult<ByteStrin
.rewind()));

return new AbstractMap.SimpleImmutableEntry<>(
Base64.getUrlEncoder().encodeToString(awakeableId.toByteArray()),
Entries.AWAKEABLE_IDENTIFIER_PREFIX
+ Base64.getUrlEncoder().encodeToString(awakeableId.toByteArray()),
deferredResult);
},
callback));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ public Stream<TestDefinition> definitions() {
expectedAwakeableId.putInt(1);
expectedAwakeableId.rewind();
String base64ExpectedAwakeableId =
Base64.getUrlEncoder().encodeToString(expectedAwakeableId.array());
Entries.AWAKEABLE_IDENTIFIER_PREFIX
+ Base64.getUrlEncoder().encodeToString(expectedAwakeableId.array());

return Stream.of(
testInvocation(this::returnAwakeableId, GreeterGrpc.getGreetMethod())
Expand Down

0 comments on commit 331365f

Please sign in to comment.