I am creating an OTP application that follows a pattern similar to that described in trapexit , where I implement a non-blocking gen_server using gen_server:call/3 to initiate a transaction with a backend and keep the transaction id mapping from pid From . When gen_server receives a message from the backend, it retrieves the transaction ID and uses this mapping to find the correct pid that it sends to the message.
In the trapexit example, this mapping is implemented using ets, however, I found that having the gen_server state contains a dict with these mappings as a very natural solution.
In my particular use case, the display will contain no more than 200 entries.
Which implementation is recommended?
Thanks in advance!
source share