Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/flipcoder/kit
C++11 libs: await, channels, reactive/signals, timelines, alarms, logging, args, etc.
https://github.com/flipcoder/kit
animation async coroutines cpp cpp11 json reactive threads timers
Last synced: about 2 months ago
JSON representation
C++11 libs: await, channels, reactive/signals, timelines, alarms, logging, args, etc.
- Host: GitHub
- URL: https://github.com/flipcoder/kit
- Owner: flipcoder
- License: mit
- Created: 2013-12-18T20:12:29.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2020-12-29T19:19:19.000Z (about 4 years ago)
- Last Synced: 2024-08-04T02:09:56.979Z (5 months ago)
- Topics: animation, async, coroutines, cpp, cpp11, json, reactive, threads, timers
- Language: C++
- Homepage:
- Size: 354 KB
- Stars: 23
- Watchers: 7
- Forks: 9
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- AwesomeCppGameDev - kit
README
# kit
Really cool C++ stuff, including modern asyncOpen-source under MIT License
Copyright (c) 2013 Grady O'Connell
## async
- Coroutines w/ YIELD(), AWAIT(), and SLEEP()
- Channels
- Async Sockets
- Event Multiplexer```c++
// MX thread 0, void future
MX[0].coro([]{
// do async stuff
auto foo = AWAIT(bar);// async sleep yield
SLEEP(chrono::milliseconds(100));
});
``````c++
// socket example
MX[0].coro([&]{
for(;;)
{
auto client = make_shared(AWAIT(server->accept()));
// coroutine per client
MX[0].coro([&, client]{
int client_id = client_ids++;
LOGf("client %s connected", client_id);
try{
for(;;)
AWAIT(client->send(AWAIT(client->recv())));
}catch(const socket_exception& e){
LOGf("client %s disconnected (%s)", client_id % e.what());
}
});
}
});```
## reactive
signals, reactive values (signal-paired vars), and lazy evaluation## meta
JSON-compatible serializable meta-objects, property trees## freq
Timelines, alarms, animation/easing, waypoints/keyframes, interpolation## log
Logger w/ error handling, thread-safe scoped indent, silencing, and capturing## math
some math stuff to use with glm## common (kit.h)
Common stuff used by other modules, including:- freezable: freeze objects as immutable
- make_unique: clone of c++14 function
- dummy_mutex
- ENTIRE() range macro
- bit() and mask()
- null_ptr_exception
- scoped_unlock
- thread-safe singleton
- timed function auto-retry
- index data structures w/ unused ID approximation