Lines Matching refs:stream
5 ;; This test calls sync stream.write in $C.get and sync stream.read in $C.set.
22 (import "" "stream.new" (func $stream.new (result i64)))
23 (import "" "stream.read" (func $stream.read (param i32 i32 i32) (result i32)))
24 (import "" "stream.write" (func $stream.write (param i32 i32 i32) (result i32)))
25 (import "" "stream.drop-readable" (func $stream.drop-readable (param i32)))
26 (import "" "stream.drop-writable" (func $stream.drop-writable (param i32)))
33 ;; ($rx, $tx) = stream.new
34 (local.set $ret64 (call $stream.new))
41 ;; (stream.write $tx $bufp 4) will block and, because called
45 (local.set $ret (call $stream.write (local.get $tx) (local.get $bufp) (i32.const 4)))
49 (call $stream.drop-writable (local.get $tx))
63 ;; (stream.read $tx $bufp 4) will block and, because called
67 (local.set $ret (call $stream.read (local.get $rx) (local.get $bufp) (i32.const 4)))
73 (call $stream.drop-readable (local.get $rx))
80 (type $ST (stream u8))
83 (canon stream.new $ST (core func $stream.new))
84 (canon stream.read $ST (memory $memory "mem") (core func $stream.read))
85 (canon stream.write $ST (memory $memory "mem") (core func $stream.write))
86 (canon stream.drop-readable $ST (core func $stream.drop-readable))
87 (canon stream.drop-writable $ST (core func $stream.drop-writable))
92 (export "stream.new" (func $stream.new))
93 (export "stream.read" (func $stream.read))
94 (export "stream.write" (func $stream.write))
95 (export "stream.drop-readable" (func $stream.drop-readable))
96 (export "stream.drop-writable" (func $stream.drop-writable))
98 (func (export "get") async (result (stream u8)) (canon lift
102 (func (export "set") async (param "in" (stream u8)) (canon lift
108 (import "get" (func $get async (result (stream u8))))
109 (import "set" (func $set async (param "in" (stream u8))))
115 (import "" "stream.new" (func $stream.new (result i64)))
116 (import "" "stream.read" (func $stream.read (param i32 i32 i32) (result i32)))
117 (import "" "stream.write" (func $stream.write (param i32 i32 i32) (result i32)))
118 (import "" "stream.drop-readable" (func $stream.drop-readable (param i32)))
119 (import "" "stream.drop-writable" (func $stream.drop-writable (param i32)))
131 ;; (stream.read $tx $bufp 4) will succeed without blocking
133 (local.set $ret (call $stream.read (local.get $rx) (local.get $bufp) (i32.const 4)))
139 (call $stream.drop-readable (local.get $rx))
141 ;; ($rx, $tx) = stream.new
143 (local.set $ret64 (call $stream.new))
148 ;; (stream.write $tx $bufp 4) will succeed without blocking
150 (local.set $ret (call $stream.write (local.get $tx) (local.get $bufp) (i32.const 4)))
154 (call $stream.drop-writable (local.get $tx))
158 (type $ST (stream u8))
159 (canon stream.new $ST (core func $stream.new))
160 (canon stream.read $ST async (memory $memory "mem") (core func $stream.read))
161 (canon stream.write $ST async (memory $memory "mem") (core func $stream.write))
162 (canon stream.drop-readable $ST (core func $stream.drop-readable))
163 (canon stream.drop-writable $ST (core func $stream.drop-writable))
168 (export "stream.new" (func $stream.new))
169 (export "stream.read" (func $stream.read))
170 (export "stream.write" (func $stream.write))
171 (export "stream.drop-readable" (func $stream.drop-readable))
172 (export "stream.drop-writable" (func $stream.drop-writable))