Neverlord on 1297
Neverlord on master
Generate valid config syntax fr… Merge pull request #1338 Gener… (compare)
Neverlord on neverlord
Neverlord on master
Fix instance getters on the met… Merge pull request #1348 Fix i… (compare)
Neverlord on neverlord
Fix shutdown behavior of socket… (compare)
sender->send(receiver, ...)
, isn't it? Generally speaking, though, CAF does not hand out pointers because actors are supposed to share no state. You handles instead. Maybe this here helps you grok how CAF is structured: https://www.cafcademy.com/articles/implementing-actors-part-1
@Neverlord Hello Dominik. We experiencing some strange caf behavior. Our CAF version is 0.17.4. We have library that has event_based_actors. Library has some method with return values, so is blocking by nature. To work with this actors we use this pseudo code
caf::scoped_actor self{system_};
int result = -1;
self
->request()
.receive(
[&](...) {
...
},
[&](caf::error& err) {
...;
});
return result;
With this code we experiencing timeout before our application with loaded library exits about 30 seconds.
We can reproduce that still one line:
caf::scoped_actor self{system_};
can produce that behavior.
Two log file with and without that line are above.
Can you share your thoughts on this. What maybe the cause?
scoped_actor
, then I don't see what might cause this in CAF itself. The constructor has no blocking code in it: https://github.com/actor-framework/actor-framework/blob/master/libcaf_core/src/scoped_actor.cpp#L41. Unless it has something to do with other factors in your application, the only thing that might block is the logger if it gets overwhelmed with log messages because it's using a fixed-size buffer (precisely to slow down an application if logs too fast for the logger to keep up). But for you to wait several seconds in this call, you would have produce tons and tons of log messages in another thread.
self->request(...).receive(...)
part LGTM tho: https://github.com/actor-framework/actor-framework/blob/master/examples/message_passing/request.cpp#L65.