@@ -1272,8 +1272,8 @@ client to asynchronously read multiple values from a (wasm or host) producer.
12721272that there is no Component Model type for passing the writable end of a
12731273stream.)
12741274``` python
1275- RevokeBuffer = Callable[[], None ]
1276- OnCopy = Callable[[RevokeBuffer ], None ]
1275+ ReclaimBuffer = Callable[[], None ]
1276+ OnCopy = Callable[[ReclaimBuffer ], None ]
12771277OnCopyDone = Callable[[CopyResult], None ]
12781278
12791279class ReadableStream :
@@ -1291,7 +1291,7 @@ The key operation is `read` which works as follows:
12911291* ` OnCopy ` is called to indicate a write has been made into the buffer.
12921292 However, there may be further writes made in the future, so the caller has
12931293 * 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
12951295 immediately regain ownership of the buffer once the first copy has completed.
12961296* ` cancel ` is non-blocking, but does ** not** guarantee that ownership of
12971297 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
13051305wasm code. Specifically, the point of the ` OnCopy* ` callbacks is to specify that
13061306* multiple* writes are allowed into the same ` WritableBuffer ` up until the point
13071307where 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
13091309reduces the number of task-switches required by the spec, particularly when
13101310streaming between two components.
13111311
@@ -3880,7 +3880,7 @@ Next, the `copy` method of `{Readable,Writable}{Stream,Future}End` is called to
38803880perform the actual read/write. The ` on_copy* ` callbacks passed to ` copy ` bind
38813881and store a ` stream_event ` closure on the readable/writable end (via the
38823882inherited ` 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
38843884ownership of ` buffer ` and prevent any further partial reads/writes. Thus, up
38853885until event delivery, the other end of the stream is free to repeatedly
38863886read/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
38903890` CopyResult ` and number of elements copied up until this point into a single
38913891` i32 ` payload for core wasm.
38923892``` python
3893- def stream_event (result , revoke_buffer ):
3894- revoke_buffer ()
3893+ def stream_event (result , reclaim_buffer ):
3894+ reclaim_buffer ()
38953895 assert (e.copying)
38963896 e.copying = False
38973897 if result == CopyResult.DROPPED :
@@ -3902,11 +3902,11 @@ all future use of this stream end. Lastly, `stream_event` packs the
39023902 return (event_code, i, packed_result)
39033903 return (event_code, i, pack_stream_result(result, buffer))
39043904
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 ))
39073907
39083908 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 :()))
39103910
39113911 e.copying = True
39123912 e.copy(task.inst, buffer, on_copy, on_copy_done)
0 commit comments