https://www.youtube.com/watch?v=XpLS2Xh_9Do
https://userver.tech/namespaces.html
https://habr.com/ru/companies/yadro/articles/751830/
Protocols tcp, sctp, udp
https://www.ibm.com/docs/ru/aix/7.2?topic=protocol-stream-control-transmission
https://www.ibm.com/docs/ru/aix/7.2?topic=protocol-stream-control-transmission
https://habr.com/ru/companies/yadro/articles/751830/
https://github.com/userver-framework
https://userver.tech/index.html
https://userver.tech/da/d16/md_en_2userver_2tutorial_2hello__service.html
https://www.dre.vanderbilt.edu/~schmidt/ACE.html
https://www.boost.org/doc/libs/1_82_0/doc/html/boost_asio.html
https://www.youtube.com/watch?v=YzZAdOsd4x0&list=PLalVdRk2RC6otl3oBU2cn-P6DWi1y1PS3
https://www.youtube.com/watch?v=IobXgpgqnYc&list=PLalVdRk2RC6otl3oBU2cn-P6DWi1y1PS3&index=12
https://www.youtube.com/watch?v=Th1A2szPctI&list=PLalVdRk2RC6otl3oBU2cn-P6DWi1y1PS3&index=13
https://github.com/codetechandtutorials/DesignPatterns/tree/master/DesignPatterns
https://habr.com/ru/articles/738250/
https://habr.com/ru/articles/656515/
Pro TBB C++ Parallel Programming with threading building blocks", Michael Voss, Rafael Asenjo, James Reinders
https://habr.com/ru/companies/wunderfund/articles/582000/
https://github.com/feabhas/coroutines-blog/tree/main/src
https://github.com/feabhas/coroutines-blog datapoint_demo.cpp
https://github.com/feabhas/coroutines-blog/blob/main/src/char_demo.cpp
#include <coroutine>
#include <optional>
#include <iostream>
#include <cassert>
#include <exception>
class Future;
struct Promise
{
using value_type = const char*;
const char* value{};
Promise() = default;
std::suspend_always initial_suspend() { return {}; }
std::suspend_always final_suspend() noexcept { return {}; }
void unhandled_exception() { std::rethrow_exception(std::current_exception()); }
std::suspend_always yield_value(const char* value) {
this->value = std::move(value);
return {};
}
// void return_value(const char* value) {
// this->value = std::move(value);
// }
void return_void() {
this->value = nullptr;
}
Future get_return_object();
};
class Future
{
public:
using promise_type = Promise;
explicit Future(std::coroutine_handle<Promise> handle)
: handle(handle)
{}
~Future() {
if (handle) { handle.destroy(); }
}
Promise::value_type next() {
if (handle) {
handle.resume();
return handle.promise().value;
}
else {
return {};
}
}
private:
std::coroutine_handle<Promise> handle{};
};
Future Promise::get_return_object()
{
return Future{ std::coroutine_handle<Promise>::from_promise(*this) };
}
// co-routine
Future Generator()
{
co_yield "Hello ";
co_yield "world";
co_yield "!";
//co_return;
}
int main()
{
/*auto generator = Generator();
std::cout << generator.next();
std::cout << generator.next();
std::cout << generator.next();
std::cout << std::endl;*/
auto generator = Generator();
while (const char* item = generator.next()) {
std::cout << item;
}
std::cout << std::endl;
return 0;
}