NHacker Next
login
▲Pipelined State Machine Corruptionflak.tedunangst.com
25 points by zdw 3 days ago | 1 comment
Loading comments...
juped 5 hours ago [-]
Erlang gen_statem permits you to postpone an event, putting it in a queue that's retried after the next state change (before moving to new events). So the MAIL FROM would put you in handle_mail_from state, and while you're in it you postpone any RCPT TOs.

Of course this might be a dumb example in this case because the process mailbox will do the right thing and be a queue if you just blockingly make the dns request in your handler process. (It also might not be, I don't know enough about the smtp state machine to say.)