Genserver calling other genserver

Hey there!

I’m working on a monitoring page in phoenix. I created a genserver for this to schedule the test for every x times with a Process_send_after. The handle_info does the check by starting other genservers. Problem is that I have to wait for some response from the started genserver before i disconnect. Right now I’m just setting the timer on the parent genserver but it seems lame. hehe =p and i wanted to ask if there is a better way to do this.

thanks, folks!

–noob here =) entering unchartered territories :scream:

I suspect that I’m not fully understanding what the problem is that you are trying to solve.

To send a message from a GenServer to it’s creator - simply

3 Likes

thanks! I will try it out! :slight_smile:

Have a look at map_reduce.ex - the function run by spawn_monitor/1 (look inside map_spawn/2) returns its result with GenServer.cast/2.