pavlos / gen_fsm

Elixir wrapper around OTP's gen_fsm
Other
40 stars 3 forks source link

No support for sync_send_event/2 #17

Closed marceloomens closed 8 years ago

marceloomens commented 8 years ago

I've just ported my code to use GenFSM.send_sync_event/2 instead of GenFSM.send_event/2. At runtime the VM complains that:

[error] ** State machine #PID<0.376.0> terminating
...
** Reason for termination = 
** {:"function not exported",
...

There seems to be a problem with synchronously executed state machines.

gausby commented 8 years ago

I am fairly sure we support sync_send_event/2. Did you remember to change your state handling function to the arity-3 version (action, from, and state)? If not try adding _from as the second argument.

gausby commented 8 years ago

Check out the turnstile example. I use and handle sync_send_event/2 a couple of times in there :)

gausby commented 8 years ago

I just reread your description...I think that you have misspelled the function. It is sync_send_event/2, not send_sync_event/2, sync before send. Does that solve the issue?

pavlos commented 8 years ago

yeah @marceloomens, @gausby is correct - I think you have a typo. Gonna close this issue, please open another one if you still have a problem