A little tangent to your question, but I’d consider a simple refactoring. Make the something handle_cast function call send_data directly instead of calling the client write function. It’s unconventional for a genserver to call its own client functions. If you really need your genserver to send itself a message, then I’d prefer to see that more explicit so that the handle_cast for something calls GenServer.cast(self(), {:write_value, "test"}