make future IO working both on go and llgo

This commit is contained in:
Li Jie
2024-09-06 22:29:42 +08:00
parent 69a2a01bc7
commit fce0672282
13 changed files with 284 additions and 610 deletions

View File

@@ -1,5 +1,5 @@
//go:build llgo11
// +build llgo11
//go:build !llgo
// +build !llgo
/*
* Copyright (c) 2024 The GoPlus Authors (goplus.org). All rights reserved.
@@ -25,7 +25,7 @@ import (
"github.com/goplus/llgo/x/async"
)
func Timeout(d time.Duration) async.IO[async.Void] {
func Timeout(d time.Duration) async.Future[async.Void] {
return async.Async(func(resolve func(async.Void)) {
go func() {
time.Sleep(d)