Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
Dominik Charousset
@Neverlord
JoaoMarinho
@JoaoAMarinho
No, I'll give it a look
JoaoMarinho
@JoaoAMarinho
Can a function-based actor, not the behavior type one, receive messages from other actors, or set an handler for these messages? So that if he receives a msg executes the handler and continues is work.
Dominik Charousset
@Neverlord
Maybe I don't get the question, but yeah, that's pretty much the point of actors.
JoaoMarinho
@JoaoAMarinho
Ok i have an actor that is receiving user input, and i tell him to parse a file so i create another ator to read the file
and i want the parser to send to the first actor the file strings
without the inputting actor stopping its process
i tried to use a set default handler but not successfully
is there any examples on this function?
Dominik Charousset
@Neverlord
Not for this particular setup, but one the examples under message_passing should help you getting started: https://github.com/actor-framework/actor-framework/tree/master/examples/message_passing
JoaoMarinho
@JoaoAMarinho
I have already looked at the examples and could not find a way to solve this
Just want to know if an actor of this kind ""void parse_input(event_based_actor* self)"" can receive messages from other actors and how?
Dominik Charousset
@Neverlord
Well, you're not returning a behavior. Hence, this actor quits immediately after running the function body. You'd need to return a behavior instead of just returning void.
JoaoMarinho
@JoaoAMarinho
Ok thanks. But a behavior returning actor needs to return immediatly right? so i can´t be receiving user input before returning the handlers
Dominik Charousset
@Neverlord
How is this actor "receiving" user input anyway? If you call some blocking function, make sure to detach the actor. :)
JoaoMarinho
@JoaoAMarinho
From the terminal. What does detaching an actor do precisely?
Dominik Charousset
@Neverlord
Please look it up in the manual.
JoaoMarinho
@JoaoAMarinho
Ok thank you.
mustafma
@mustafma
Hi, can I define enum class as a result of the custom atom definition? Trying to use that in typed_actor class ? Doing this fails in build. Do I need to define an inspector for such cases ?
Dominik Charousset
@Neverlord
The atom macros define empty structs. If you wish to use an enum, than it's just a custom type to CAF that need an inspect.
mustafma
@mustafma
image.png
Thanks. I have tried this with no success:
Dominik Charousset
@Neverlord
Can you define "no success"? What's the actual issue? Aside from the code running into UB since it's not returning a value.
Cem Degirmenci
@sputnikcem_twitter
Hello everyone
Dominik Charousset
@Neverlord
Hi! 👋
Cem Degirmenci
@sputnikcem_twitter
I was reading the code of the framework, and would like to ask what is upstream and downstream messages?
in the scheduled_actor class one can get 4 types of queues, urgent, normal, upstream and downstream forexample
Dominik Charousset
@Neverlord
This only relates to streaming pipelines. Hopefully this helps to clean up the terminology: https://actor-framework.readthedocs.io/en/stable/Streaming.html.
But be aware that this is an experimental feature and it looks like it's soon replaces with something else.
Cem Degirmenci
@sputnikcem_twitter
thank you!
Dominik Charousset
@Neverlord
Hope it helps. :)
Krzysztof Wrzalik
@kyku
Hi, I'm trying to fix a strange segfault from CAF
It is triggered from message_data::~message_data() after my message handler has returned. The the problem is with meta.destroy(ptr); line, in which detroy() is basically a null function pointer.
Krzysztof Wrzalik
@kyku
ok, my fault
doncoolhoney
@doncoolhoney_twitter
My hello program code doesnt work anyone caould please help??
unction "mirror" returns incomplete type "caf::behavior" and alot of other errors..
can anyone pleaase guide to run hello worlld program steps..... i have compiled camke completely...
Dominik Charousset
@Neverlord
I think that's out of scope for a chat like this. But I'm sure you can find good CMake tutorials online. Incomplete type usually means you didn't include the proper headers or your include paths aren't correct.
Cem Degirmenci
@sputnikcem_twitter
Hi I have created an example to study the difference between request.then and request.await. I have a scoped actor which sends 5 messages to a master actor and this master actor in its behavior sends a message to a slave actor which returns the sum of 2 integer and sleeps for 1 seconds.
It is as expected i.e. if I use then I see that masters behaviors are activated without waiting for slave answers
the question is when I use <message_priority::high> await does not function after the first call
is this expected?
image.png
image.png
Cem Degirmenci
@sputnikcem_twitter
image.png
Cem Degirmenci
@sputnikcem_twitter
ah I see, if the master also sends the message with high priority the problem is solved
Cem Degirmenci
@sputnikcem_twitter
can one use OpenMP with the Actor framework? I can compile and run the code but can only get a single omp thread running
Dominik Charousset
@Neverlord
Regarding the high-prio: you shouldn't need to forward it with hight priority. Mind making a minimal example and open a GitHub issue?
OpenMP: be careful when combining CAF with any other framework that spins up a thread pool on its own. If both are busy, you pay for a lot of context switches by overbooking the CPU.
Cem Degirmenci
@sputnikcem_twitter
for the OpenMP question -fopenmp should be added to both compile and link flags in the CMakefile if anyone wants to use it
doncoolhoney
@doncoolhoney_twitter

Anyone have a short but good example of middleman in CAF..Please share.. because I am facing issues in publishing....

invalid use of incomplete type ‘class caf::io::middleman’

Any small example please!..

Dominik Charousset
@Neverlord
Incomplete type usually means you're only having a forward declaration, i.e., you're missing the include. An example for publish/remote_actor is here: https://github.com/actor-framework/actor-framework/blob/master/examples/remoting/distributed_calculator.cpp.