aboutsummaryrefslogtreecommitdiff
path: root/lib/coroutines/README.md
blob: eef923e0f7f66f9313366944c8f38f5743ffbd6f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# Tomo Coroutine Library

This is a coroutine library built on top of a modified version of
[libaco](https://libaco.org).

## Example Usage

```tomo
use coroutines

func main()
    co := Coroutine(func()
        say("I'm in the coroutine!")
        yield()
        say("I'm back in the coroutine!")
    )
    >> co
    say("I'm in the main func")
    >> co.resume()
    say("I'm back in the main func")
    >> co.resume()
    say("I'm back in the main func again")
    >> co.resume()
```