All Projects → dragonglasscom → AsyncUtils

dragonglasscom / AsyncUtils

Licence: MIT License
A set of utilities for Asynchronous programming in Unity.

Programming Languages

C#
18002 projects

Projects that are alternatives of or similar to AsyncUtils

Swiftcoroutine
Swift coroutines for iOS, macOS and Linux.
Stars: ✭ 690 (+4500%)
Mutual labels:  coroutines, thread
fluid-mongo
Kotlin coroutine support for MongoDB built on top of the official Reactive Streams Java Driver
Stars: ✭ 27 (+80%)
Mutual labels:  coroutines
fastthreadpool
An efficient and lightweight thread pool
Stars: ✭ 27 (+80%)
Mutual labels:  thread
GitHubApplication
GitHubApplication 📱 is an Android application built to demonstrate the use of modern Android development tools - (Kotlin, Coroutines, Hilt, LiveData, View binding, Data Store, Architecture components, MVVM, Room, Retrofit, Navigation).
Stars: ✭ 11 (-26.67%)
Mutual labels:  coroutines
moko-errors
Automated exceptions handler for mobile (android & ios) Kotlin Multiplatform development.
Stars: ✭ 45 (+200%)
Mutual labels:  coroutines
kit
C++11 libs: await, channels, reactive/signals, timelines, alarms, logging, args, etc.
Stars: ✭ 21 (+40%)
Mutual labels:  coroutines
GitKtDroid
A sample Android application📱 built with Kotlin for #30DaysOfKotlin
Stars: ✭ 53 (+253.33%)
Mutual labels:  coroutines
LockFreeHashTable
Lock Free Resizable Hash Table Based On Split-Ordered Lists.
Stars: ✭ 45 (+200%)
Mutual labels:  thread
eff.lua
ONE-SHOT Algebraic Effects for Lua!
Stars: ✭ 32 (+113.33%)
Mutual labels:  coroutines
Keemun
No description or website provided.
Stars: ✭ 13 (-13.33%)
Mutual labels:  coroutines
kotlinx-sockets
Kotlinx coroutines sockets
Stars: ✭ 54 (+260%)
Mutual labels:  coroutines
Retrofit2-Flow-Call-Adapter
A Retrofit 2 adapter for Kotlin Flows.
Stars: ✭ 41 (+173.33%)
Mutual labels:  coroutines
Saga
Saga pattern implementation in Kotlin build in top of Kotlin's Coroutines.
Stars: ✭ 24 (+60%)
Mutual labels:  coroutines
Paging-3-Sample
This app is created as a sample app which loads movies from Tmdb api and uses Paging 3 library to show it in a Recycler view.
Stars: ✭ 96 (+540%)
Mutual labels:  coroutines
Kotlin-Coroutine-Flow
Search engine functionality using Kotlin Coroutines and Flow
Stars: ✭ 25 (+66.67%)
Mutual labels:  coroutines
CS302-Operating-System
OS course of SUSTech
Stars: ✭ 18 (+20%)
Mutual labels:  thread
JustJava-Android
JustJava is a mock food ordering and delivery application for a coffee shop.
Stars: ✭ 59 (+293.33%)
Mutual labels:  coroutines
tgrid
TypeScript Grid Computing Framework supporting RFC (Remote Function Call)
Stars: ✭ 83 (+453.33%)
Mutual labels:  thread
DeezerClone
This Application using Dagger Hilt, Coroutines, Flow, Jetpack (Room, ViewModel, LiveData),Navigation based on MVVM architecture.
Stars: ✭ 81 (+440%)
Mutual labels:  coroutines
Jacob
A lightweight library to provide coroutines in Java
Stars: ✭ 14 (-6.67%)
Mutual labels:  coroutines

AsyncUtils

A set of utilities for Asynchronous programming in Unity.

Motivation

Use clean, async style web requests with better exception handling instead of coroutine hell.
Provide easier task composition and cancellation.
Provide easy to implement conversion and compatibility with older Coroutine style code.

Thread safety

Most of the entities in Unity API are not thread safe.
Methods from this library are thread aware and will be pushed to Unity's Main thread's synchronization context for execution.
Cancellation of requests is also handled in the safe manner.

Installation

Navigate to Player Settings and make sure your Scripting Runtime Version is set to .NET 4.6 Equivalent.
Copy Assets/Plugins folder into your Project's Assets folder.

Usage

Making Web Requests

Simply call WebrequestUtils.();
Theese methods are awaitable, provide cancellation, and are thread safe (posted onto main thread).

public async void Start()
{
    var req = await WebRequestUtils.Get("https://ipinfo.io");

    Debug.Log(req.ReadToEnd());
}

Awaiting coroutines

With .net 4.6 script runtime anything that returns IEnumerator is awaitable.
Can be used like so:

public async void Start()
{
    var req = await WaitForSomething();
}
    
public IEnumerator WaitForSomething()
{
     while(isSomethingCompleded)
         yield return null;
}

References

The library is based on this asset.
It was enhanced with support for true async style Http requests.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].