@@ -1272,8 +1272,8 @@ client to asynchronously read multiple values from a (wasm or host) producer.
1272
1272
that there is no Component Model type for passing the writable end of a
1273
1273
stream.)
1274
1274
``` python
1275
- RevokeBuffer = Callable[[], None ]
1276
- OnCopy = Callable[[RevokeBuffer ], None ]
1275
+ ReclaimBuffer = Callable[[], None ]
1276
+ OnCopy = Callable[[ReclaimBuffer ], None ]
1277
1277
OnCopyDone = Callable[[CopyResult], None ]
1278
1278
1279
1279
class ReadableStream :
@@ -1291,7 +1291,7 @@ The key operation is `read` which works as follows:
1291
1291
* ` OnCopy ` is called to indicate a write has been made into the buffer.
1292
1292
However, there may be further writes made in the future, so the caller has
1293
1293
* not* regained ownership of the buffer.
1294
- * The ` RevokeBuffer ` callback passed to ` OnCopy ` allows the caller of ` read ` to
1294
+ * The ` ReclaimBuffer ` callback passed to ` OnCopy ` allows the caller of ` read ` to
1295
1295
immediately regain ownership of the buffer once the first copy has completed.
1296
1296
* ` cancel ` is non-blocking, but does ** not** guarantee that ownership of
1297
1297
the buffer has been returned; ` cancel ` only lets the caller * request* that
@@ -1305,7 +1305,7 @@ concurrent behaviors of `stream.{read,write}` and not exposed directly to core
1305
1305
wasm code. Specifically, the point of the ` OnCopy* ` callbacks is to specify that
1306
1306
* multiple* writes are allowed into the same ` WritableBuffer ` up until the point
1307
1307
where either the buffer is full or the calling core wasm code receives the
1308
- ` STREAM_READ ` progress event (in which case ` RevokeBuffer ` is called). This
1308
+ ` STREAM_READ ` progress event (in which case ` ReclaimBuffer ` is called). This
1309
1309
reduces the number of task-switches required by the spec, particularly when
1310
1310
streaming between two components.
1311
1311
@@ -3880,7 +3880,7 @@ Next, the `copy` method of `{Readable,Writable}{Stream,Future}End` is called to
3880
3880
perform the actual read/write. The ` on_copy* ` callbacks passed to ` copy ` bind
3881
3881
and store a ` stream_event ` closure on the readable/writable end (via the
3882
3882
inherited ` Waitable.set_event ` ) which will be called right before the event is
3883
- delivered to core wasm. ` stream_event ` first calls ` revoke_buffer ` to regain
3883
+ delivered to core wasm. ` stream_event ` first calls ` reclaim_buffer ` to regain
3884
3884
ownership of ` buffer ` and prevent any further partial reads/writes. Thus, up
3885
3885
until event delivery, the other end of the stream is free to repeatedly
3886
3886
read/write from/to ` buffer ` , ideally filling it up and minimizing context
@@ -3890,8 +3890,8 @@ all future use of this stream end. Lastly, `stream_event` packs the
3890
3890
` CopyResult ` and number of elements copied up until this point into a single
3891
3891
` i32 ` payload for core wasm.
3892
3892
``` python
3893
- def stream_event (result , revoke_buffer ):
3894
- revoke_buffer ()
3893
+ def stream_event (result , reclaim_buffer ):
3894
+ reclaim_buffer ()
3895
3895
assert (e.copying)
3896
3896
e.copying = False
3897
3897
if result == CopyResult.DROPPED :
@@ -3902,11 +3902,11 @@ all future use of this stream end. Lastly, `stream_event` packs the
3902
3902
return (event_code, i, packed_result)
3903
3903
return (event_code, i, pack_stream_result(result, buffer))
3904
3904
3905
- def on_copy (revoke_buffer ):
3906
- e.set_event(partial(stream_event, CopyResult.COMPLETED , revoke_buffer ))
3905
+ def on_copy (reclaim_buffer ):
3906
+ e.set_event(partial(stream_event, CopyResult.COMPLETED , reclaim_buffer ))
3907
3907
3908
3908
def on_copy_done (result ):
3909
- e.set_event(partial(stream_event, result, revoke_buffer = lambda :()))
3909
+ e.set_event(partial(stream_event, result, reclaim_buffer = lambda :()))
3910
3910
3911
3911
e.copying = True
3912
3912
e.copy(task.inst, buffer, on_copy, on_copy_done)
0 commit comments