| 1 |
(module $actor-scheduler |
| 2 |
(type $func (;0;) (func)) |
| 3 |
(type $cont (;1;) (cont $func)) |
| 4 |
(type $cont-func (;2;) (func (param (ref $cont)))) |
| 5 |
(type $cont-cont (;3;) (cont $cont-func)) |
| 6 |
(type $f-func (;4;) (func (param (ref $func)))) |
| 7 |
(import "actor-as-lwt" "act" (func $act (;0;) (type $cont-func))) |
| 8 |
(import "scheduler" "run" (func $scheduler (;1;) (type $cont-func))) |
| 9 |
(export "run-actor" (func $run-actor)) |
| 10 |
(elem (;0;) declare func $act $scheduler) |
| 11 |
(func $run-actor (;2;) (type $cont-func) (param $k (ref $cont)) |
| 12 |
local.get $k |
| 13 |
ref.func $act |
| 14 |
cont.new $cont-cont |
| 15 |
cont.bind $cont-cont $cont |
| 16 |
call $scheduler |
| 17 |
) |
| 18 |
) |