Skip to content

Repository files navigation

AwaitableCoroutine

AwaitableCoroutine is a library for C# that provides a coroutine that allows the use of async/await syntax. Internally it uses Task-Like, the Awaitable pattern, and AsyncMethodBuilder.

AwaitableCoroutine は、async/await 構文を使用可能にしたコルーチンを提供する C# 向けライブラリです。 内部的にはTask-Like、Awaitable パターン、AsyncMethodBuilder が使われています。

Installation

Install from NuGet Gallery

PackageIdBadge
AwaitableCoroutineAwaitableCoroutine - NuGet Gallery
AwaitableCoroutine.Altseed2AwaitableCoroutine.Altseed2 - NuGet Gallery
AwaitableCoroutine.FSharpAwaitableCoroutine.FSharp - NuGet Gallery

Documentation

langlink
jaドキュメント
enDocument

Example

usingSystem;usingAwaitableCoroutine;varrunner=newCoroutineRunner();intcount=0;varcoroutine=runner.Create(async()=>{Console.WriteLine("Started!");for(vari=0;i<10;i++){count++;awaitCoroutine.Yield();}}).OnCompleted(()=>Console.WriteLine("Finished!"));while(true){runner.Update();if(coroutine.IsCompletedSuccessfully)break;Console.WriteLine($"{count}");}
$ dotnet run --project examples/AwaitableCoroutine.Example
Started!
0
1
2
3
4
5
6
7
8
9
10
Finished!

see examples in detail.

Command (for dev)

Setup

$ dotnet tool restore

Build

$ dotnet fake build [-- <DEBUG|RELEASE>]

Default configuration is DEBUG

Format

$ dotnet fake build -t format

Test

$ dotnet fake build -t test

Pack

$ dotnet pack -c Release

About

No description or website provided.

Topics

Resources

Stars

16 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages