You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: python/restate/context.py
+17-11Lines changed: 17 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -132,15 +132,15 @@ def get(self,
132
132
name: str,
133
133
serde: Serde[T] =DefaultSerde(),
134
134
type_hint: Optional[typing.Type[T]] =None
135
-
) ->Awaitable[Optional[Any]]:
135
+
) ->Awaitable[Optional[T]]:
136
136
"""
137
137
Retrieves the value associated with the given name.
138
138
139
139
Args:
140
140
name: The state name
141
-
serde: The serialization/deserialization mechanism. - if the default serde is used, a default serializer will be used based on the type.
141
+
serde: The serialization/deserialization mechanism. - if the default serde is used, a default serializer will be used based on the type.
142
142
See also 'type_hint'.
143
-
type_hint: The type hint of the return value. This is used to pick the serializer. If None, the type hint will be inferred from the action's return type, or the provided serializer.
143
+
type_hint: The type hint of the return value. This is used to pick the serializer. If None, the type hint will be inferred from the action's return type, or the provided serializer.
144
144
"""
145
145
146
146
@abc.abstractmethod
@@ -213,15 +213,15 @@ def run(self,
213
213
Args:
214
214
name: The name of the action.
215
215
action: The action to run.
216
-
serde: The serialization/deserialization mechanism. - if the default serde is used, a default serializer will be used based on the type.
216
+
serde: The serialization/deserialization mechanism. - if the default serde is used, a default serializer will be used based on the type.
217
217
See also 'type_hint'.
218
218
max_attempts: The maximum number of retry attempts to complete the action.
219
219
If None, the action will be retried indefinitely, until it succeeds.
220
220
Otherwise, the action will be retried until the maximum number of attempts is reached and then it will raise a TerminalError.
221
221
max_retry_duration: The maximum duration for retrying. If None, the action will be retried indefinitely, until it succeeds.
222
222
Otherwise, the action will be retried until the maximum duration is reached and then it will raise a TerminalError.
223
223
type_hint: The type hint of the return value of the action.
224
-
This is used to pick the serializer. If None, the type hint will be inferred from the action's return type, or the provided serializer.
224
+
This is used to pick the serializer. If None, the type hint will be inferred from the action's return type, or the provided serializer.
225
225
226
226
"""
227
227
@@ -327,7 +327,7 @@ def generic_send(self,
327
327
defawakeable(self,
328
328
serde: Serde[T] =DefaultSerde(),
329
329
type_hint: Optional[typing.Type[T]] =None
330
-
) ->typing.Tuple[str, RestateDurableFuture[Any]]:
330
+
) ->typing.Tuple[str, RestateDurableFuture[T]]:
331
331
"""
332
332
Returns the name of the awakeable and the future to be awaited.
333
333
"""
@@ -388,15 +388,15 @@ def get(self,
388
388
name: str,
389
389
serde: Serde[T] =DefaultSerde(),
390
390
type_hint: Optional[typing.Type[T]] =None
391
-
) ->RestateDurableFuture[Optional[Any]]:
391
+
) ->RestateDurableFuture[Optional[T]]:
392
392
"""
393
393
Retrieves the value associated with the given name.
394
394
395
395
Args:
396
396
name: The state name
397
-
serde: The serialization/deserialization mechanism. - if the default serde is used, a default serializer will be used based on the type.
397
+
serde: The serialization/deserialization mechanism. - if the default serde is used, a default serializer will be used based on the type.
398
398
See also 'type_hint'.
399
-
type_hint: The type hint of the return value. This is used to pick the serializer. If None, the type hint will be inferred from the action's return type, or the provided serializer.
399
+
type_hint: The type hint of the return value. This is used to pick the serializer. If None, the type hint will be inferred from the action's return type, or the provided serializer.
0 commit comments