I have a GenServer that owns a serial connection to a measuring instrument. Clients send commands through it. With GenServer.call/2 I sometimes get an exit with a timeout when the instrument is slow; with GenServer.cast/2 there are no errors, but under load the process's memory grows and replies arrive late.
How do I choose between call and cast, and what is the right way to deal with slow operations inside the server?




