I have an erlang gen_fsm process that talks to a remote server via tcp using erlang's built-in gen_tcp.
I would like to make this a web-socket client. Upon some investigation, I got this erlang websocket client library Erlang Websocket client.
looking at some examples, it looks like I have to use the
-behaviour(websocket_client_handler).
Basically, I do this in my start_link
start_link(UserID) ->
gen_fsm:start_link(?MODULE, [UserID], []).
However, the other behavior expects a different return values for the init and a different state. I already have a state for my gen_fsm.
Can someone throw some context around this.
I think it is nothing wrong in having two behaviors defined for the same module but given that each behavior requires different return types in the init/[1/2] functions, I start to think if this is really something feasible. Just wanted to reach out to someone experienced.
Thanks.