Is it safe to do something like this:

auto paf = kj::newPromiseAndFulfiller<T>();
beginAsyncTask(paf.fulfiller.get());
return paf.promise.attach(kj::mv(paf.fulfiller));

I think that should be fine, as long as beginAsyncTask eventually resolves
or rejects the supplied fulfiller, right? The context here is that I'm
resolving the fulfiller within a lambda that gets stored in a
std::function, and if I capture the Own<PromiseFulfiller> in a lambda,
std::function won't work. I welcome better ways to address this issue also.
-- 
Nathan Hourt

*The Truth will set you free*

-- 
You received this message because you are subscribed to the Google Groups 
"Cap'n Proto" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
Visit this group at https://groups.google.com/group/capnproto.

Reply via email to