1

For example: state looks like this:

state1({call,Caller},Msg,Data) ->
    NewData = do_somthing(),
    {next_State,state2,NewData,[{reply,Caller,NewMsg},{state_timeout,5000,any}]}.

timeout state:

state2(state_timeout,Msg,Data) ->
    something() ( Here my question)

I need to return a Message when timeout is occuer. How can I do that if I dont know who is the Caller at state2(state_timeout,Msg,Data)?

ersa
  • 81
  • 7

1 Answers1

0

Data can be anything you want:

NewData = {do_something(), Caller},

then:

state2(state_timeout,Msg,{Data, Caller}) ->
7stud
  • 46,922
  • 14
  • 101
  • 127