add Future.Then

This commit is contained in:
Li Jie
2024-09-08 20:27:05 +08:00
parent cf53f3a347
commit 566d5ef96f
9 changed files with 56 additions and 32 deletions

View File

@@ -59,7 +59,7 @@ func Run[T any](future Future[T]) T {
exec := &Executor{loop}
oldExec := setExec(exec)
var ret T
future(func(v T) {
future.Then(func(v T) {
ret = v
})
exec.Run()