Download

tomo-coroutines

A Tomo library for coroutines

  • Tomo
Docs 1.7K wordsText 1.6KMarkdown 76
NameModifiedLinesSize
.gitignore 2 lines<1% of this folder's lines 15 B<1% of this folder's bytes
ACO_LICENSE 202 lines17% of this folder's lines 11.1 KiB26% of this folder's bytes
CHANGES.md 9 lines<1% of this folder's lines 81 B<1% of this folder's bytes
README.md 31 lines3% of this folder's lines 630 B1% of this folder's bytes
aco.c 458 lines39% of this folder's lines 17.1 KiB40% of this folder's bytes
aco.h 213 lines18% of this folder's lines 6.5 KiB15% of this folder's bytes
acoyield.S 208 lines18% of this folder's lines 5.7 KiB13% of this folder's bytes
coroutines.tm 64 lines5% of this folder's lines 1.6 KiB4% of this folder's bytes
packages.ini 0 lines0% of this folder's lines 0 B0% of this folder's bytes

README.md

Tomo Coroutine Library

This is a coroutine library for Tomo built on top of a modified version of libaco.

Example Usage

# modules.ini
[coroutines]
version=v1.0
git=https://github.com/bruce-hill/tomo-coroutines
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()