Elixir Blog Posts

I think you have a bug there. Generally, you need to keep a lookup table in the GenServer for all outstanding requests, keyed of an opaque token and pass the token down to the async process so you can figure which request is from which client and reply accordingly. You only have a field from_pid in the GenServer state, so concurrent clients are going to step on each other’s toe, the replies will get misdirected, and your clients will hang.