Creating process from GenServer and passing state

You can also check this thread which has a complete example and explanation:

Best regards,