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
-**json_marshal and json_unmarshal**: encode to and decode from JSON bytes, decode takes the target type as a generic param
@@ -221,9 +221,9 @@ You can think of a `@flow` function as a durable goroutine that can survive appl
221
221
@flow
222
222
asyncdefcodec(data: bytes):
223
223
nums: list[int] | DSError
224
-
nums = json_unmarshal[list[int]](data)
224
+
nums =awaitjson_unmarshal[list[int]](data)
225
225
raw: bytes| DSError
226
-
raw = json_marshal([1, 2, 3])
226
+
raw =awaitjson_marshal([1, 2, 3])
227
227
```
228
228
229
229
-**pure function**: `@pure` marked deterministic functions that don't have any side effects, run inline without a checkpoint, e.g. `status = get_status(resp)` where:
@@ -236,7 +236,7 @@ You can think of a `@flow` function as a durable goroutine that can survive appl
236
236
return resp.Status
237
237
```
238
238
239
-
-**impure function**: `@impure` marked side-effect functions whose result is run once and checkpointed, e.g. `insert_event(name)` where:
239
+
-**impure function**: `@impure` marked side-effect functions whose result is run once and checkpointed, e.g. `await insert_event(name)` where:
240
240
241
241
```python
242
242
import psycopg2
@@ -254,7 +254,7 @@ You can think of a `@flow` function as a durable goroutine that can survive appl
254
254
255
255
@flow
256
256
asyncdefrecord(name: str):
257
-
insert_event(name)
257
+
awaitinsert_event(name)
258
258
```
259
259
260
260
-**Flow call**: call another `@flow` function directly, it runs durably and returns its value
@@ -269,7 +269,7 @@ You can think of a `@flow` function as a durable goroutine that can survive appl
269
269
270
270
@flow
271
271
asyncdefcaller():
272
-
total: int= adder(3, 5)
272
+
total: int=awaitadder(3, 5)
273
273
```
274
274
275
275
-**create_task**: spawn a child flow that runs concurrently
@@ -279,7 +279,7 @@ You can think of a `@flow` function as a durable goroutine that can survive appl
279
279
280
280
@flow
281
281
asyncdefchild(n: int):
282
-
sleep(1.0)
282
+
awaitsleep(1.0)
283
283
284
284
285
285
@flow
@@ -311,7 +311,7 @@ You can think of a `@flow` function as a durable goroutine that can survive appl
0 commit comments