loveyacper / ananas Goto Github PK
View Code? Open in Web Editor NEWA C++11 RPC framework based on future and protobuf, with utility: timer,ssl,future/promise,log,coroutine,etc
License: MIT License
A C++11 RPC framework based on future and protobuf, with utility: timer,ssl,future/promise,log,coroutine,etc
License: MIT License
exception_.~exception_ptr()
1、Try的析构函数中,不能调用~exception_ptr();
2、在seastar的源码处理中,有过类似的处理future.hh中的struct future_state_base ;
给出的官方处理链接如下:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90295
note: 参见对正在编译的函数 模板 实例化“ananas::Future ananas::Future::_ThenImpl<F,R,T&&>(ananas::Scheduler *,F &&,ananas::internal::ResultOfWrapper<F,T &&>)”的引用
1> with
1> [
1> F=main::<lambda_0ca2531bee9689aededc86c496028799>,
1> R=ananas::internal::CallableResult<main::<lambda_0ca2531bee9689aededc86c496028799>,int>,
1> T=int
1> ]
我用msvc编译提示这个,但是能编译过去的,警告降到2级就不会提示···有问题吗这个!
ananas::MakeReadyFuture()
.Then([] {
throw std::runtime_error("rrrrrrrrrrrrrrrrrrr");
return std::string{"Hello1"};
})
.Then([](ananas::Try<std::string>&& str) {
try {
std::string a = str;
std::cout << a << std::endl;
return 100;
} catch (const std::runtime_error&) {
std::cout << "xxxxxx" << std::endl;
// 希望发生异常以后 退出 这个回调链
return 888;
}
})
.Then([](int nn) {
std::cout << nn << std::endl;
});
static_assert(std::is_same<T, void>::value ||
std::is_copy_constructible() ||
std::is_move_constructible(),
"must be copyable or movable or void");
修改为
static_assert(std::is_same<T, void>::value ||
std::is_copy_constructible::value ||
std::is_move_constructible::value,
"must be copyable or movable or void");
能否实现shared_future,类似boost::shared_future
这种capture的方式在C++11标准下会报警告,麻烦看下是否可以修复。
dep/ananas/future/Future.h:489:26: warning: lambda capture initializers only available with -std=c++14 or -std=gnu++14
prom = std::move(pm)](typename TryWrapper<T>::Type&& t) mutable {
dep/ananas/future/Future.h:491:28: warning: lambda capture initializers only available with -std=c++14 or -std=gnu++14
auto cb = [func = std::move(func), t = std::move(t), prom = std::move(prom)]() mutable {
网络的一些操作还是基于epoll的异步回调的,比如connector中的非阻塞连接行为, 能否具有类似
connect().then([] { onSuccess(); })
的同步调用模式呢?
另外,同步阻塞操作的异步化都是通过线程池的方式实现的,这里能不能考虑使用协程而不是线程来避免线程上下文切换的开销呢?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.