I have a client API used to send messages to a Genserver. I want to drop messages (have the client API return
:dropped for instance) if the mailbox of the Genserver has more than a certain amount of messages.
After research, it seems like the best way to do this is to call
Process.info on the Genserver’s
pid and drop messages based on
:message_queue_len. Is this the best way to do this? I decided to not use
:sys.get_status since it seems to send a message to the Genserver which will be processed only AFTER all prior messages are processed (thus not getting the real time value of the messages in a Genserver’s mailbox.)