https://github.com/alphafantomu/kagura-mea
A lightweight async function binder, named after only the most loved virtual youtuber, Kagura Mea.
https://github.com/alphafantomu/kagura-mea
async bind kagura library libuv lightweight lua luvit mea vtuber
Last synced: 3 months ago
JSON representation
A lightweight async function binder, named after only the most loved virtual youtuber, Kagura Mea.
- Host: GitHub
- URL: https://github.com/alphafantomu/kagura-mea
- Owner: alphafantomu
- License: mit
- Created: 2022-05-16T23:08:06.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2022-10-31T08:13:26.000Z (over 2 years ago)
- Last Synced: 2025-01-01T18:27:08.834Z (5 months ago)
- Topics: async, bind, kagura, library, libuv, lightweight, lua, luvit, mea, vtuber
- Language: Lua
- Homepage:
- Size: 5.86 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# kagura-mea
A lightweight async function binder, named after only the most loved virtual youtuber, Kagura Mea.# Installation
lit needs to be installed in your system, to install kagura-mea please run the following command:
```bash
lit install alphafantomu/kagura-mea
```# Usage
The library returns a function which will be used to wrap synchronous functions, an example using coroutines is shown below:```lua
local async = require('kagura-mea').async;local waitFive = async(function(n)
local uv = require('uv');
local t = uv.thread_self();
uv.sleep(5000);
return nil, n * n, n;
end);coroutine.wrap(function()
local thread = coroutine.running();
waitFive(5, function(...)
print(...);
coroutine.resume(thread);
end)
print'got here';
coroutine.yield();
print'woohoo';
end)();coroutine.wrap(function()
local thread = coroutine.running();
waitFive(5, function(...)
print(...);
coroutine.resume(thread);
end)
print'got here';
coroutine.yield();
print'woohoo';
end)();
```# Kagura Mea
You can find her socials here:
- [Youtube](https://www.youtube.com/channel/UCWCc8tO-uUl_7SJXIKJACMw)
- [Twitter](https://twitter.com/KaguraMea_VoV)
- [Bilibili](https://space.bilibili.com/349991143)
- [Her Merchanise](https://kaguramea.booth.pm/)
- [Her Tip](https://streamlabs.com/kaguramea0x0/tip)# Disclaimer
There is no affiliation with Kagura Mea.# License
[MIT License](/LICENSE)# Contact
- Discord: `Arivistraliavatoriar#2678`