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

@@ -83,17 +83,6 @@ func Callback3[Base any, A any, B any, C any](base *Base, a A, b B, c C) {
* libuv.InitTimer(async.Exec().L, timer)
* timer.Start(cb, 1000, 0)
*
* TODO(lijie): fn isn't a C func-ptr, it's closure, should fix the LLGo compiler.
* See: https://github.com/goplus/llgo/issues/766
*
* Workaround:
*
* timer, _ := cbind.Bind[libuv.Timer](func() {
* println("hello")
* })
* libuv.InitTimer(async.Exec().L, timer)
* timer.Start(cbind.Callback[libuv.Timer], 1000, 0)
*
* @param call The Go function to bind.
* @return The data pointer and the C callback function.
*/