[erlang-questions] gen_statem confusion

Fred Hebert <>
Fri Jan 20 17:12:52 CET 2017


On 01/20, Vans S wrote:
>
>The issue I am grappling with now is if we fail on the subscription to the 3rd party API
>(subscription via udp or tcp) we need to try again.  Trying again we use state_timeout
>but this opens a gap for messages to be processed.  A possible approach would be to have a
>catch_all handler for cast/call/info for all states that =/= step3_process_messages, it can
>offload the mailbox to state for later processing or reply with a certain error like
>not_ready_for_msgs.
>

You may only need to use `postpone` functionality, which will re-enqueue 
the message until a state change.


More information about the erlang-questions mailing list