Neverlord on 1368
Neverlord on master
Provide `*_weak` variants of `s… Merge pull request #1368 Documentation nitpicks and 3 more (compare)
Neverlord on 1368
Fix formatting Add tests for run_delayed and r… (compare)
josephnoir on master
Handle void results in fan_out_… Merge pull request #1373 Handl… (compare)
josephnoir on 1369
Neverlord on 1369
Handle void results in fan_out_… (compare)
There's not enough context to tell what's going wrong on MSVC. The static assert usually triggers when forgetting some includes, but that wouldn't explain why it worked for you on Linux.
Btw, if you're evaluating CAF on Windows: there's a performance issue that's been fixed recently actor-framework/actor-framework#1343.
--my-list
argument)
void foo(typed_actor parent) {
auto spawned = parent->spawn(new_actor);
parent->request(std::move(spawned), int{5}).then([]{});
}
is such function legal? It seems to me that the spawned actor may die and "then" will never be called. Is the lifetime somehow preserved here or are my worries justified?
server_impl
, which sound like a good approximation what you're trying to do?
IIUC @patszt's problem correctly then the problem actually occurs when you return the response handle from his example function, because the response handle does not keep a strong reference to the destination actor. We ran into this when upgrading from CAF 0.17 to CAF 0.18 (yes we're finally getting to it), and were wondering if this was a change in behavior. The behavior we see is that a .then(...)
on the response handle returned from this function was always replied to with a caf::sec::broken_promise
. The requested handler of the destination actor always created a response promise.
Do you know if it's feasible to backport the CAF 0.18 response promise to CAF 0.17 to make this part of the transition easier?
What is the "destination actor" in your case? Let's say we have a communication pattern like A -> B -> C. A sends a request to B. B sends another request to C, holding onto a response promise. C responds normally.
B has a response promise, which holds a strong_actor_ptr
back to A (https://github.com/actor-framework/actor-framework/blob/master/libcaf_core/caf/response_promise.hpp#L201). C has a message in its mailbox, so CAF should hold an implicit reference to it at least until it has responded. That's how I understand it. Where are my assumptions wrong?
broken_promise
from my understanding, because the message in C should keep B alive (first the request message in the mailbox of C itself and then of course the response message in B).
.then
on the response handle.
.then
.
Hm. Without code, I'm not quite sure how B is supposed to deliver its promise if it's not doing any messaging after that.
@dominiklohmann Different question. :)
Are you guys are using operator*
for actors anywhere outside of pre-0.19 streams? This 'pipelining operator' was added to make the "auto-magic" stream handshakes work, so I'm wondering whether there are any use cases left after pulling out the streams. Getting rid of this feature would go a long way in reducing complexity in the messaging layer again.