View Source jarl_connection (jarl v1.1.0)

JSONRpc 2.0 Websocket connection

Summary

Functions

callback_mode()

connected(EventType, EventContent, Data)

connecting(EventType, EventContent, Data)

disconnect(Conn)

-spec disconnect(Conn :: pid()) -> ok.

init(_)

notify(Conn, Method, Params)

-spec notify(Conn :: pid(), Method :: jarl:method(), Params :: map()) ->
                ok | {jarl_error, not_connected}.

reply(Conn, Result, ReqRef)

-spec reply(Conn :: pid(), Result :: any(), ReqRef :: binary() | integer()) ->
               ok | {jarl_error, not_connected}.

reply(Conn, Code, Message, ErData, ReqRef)

-spec reply(Conn :: pid(),
            Code :: atom() | integer(),
            Message :: undefined | binary(),
            ErData :: term(),
            ReqRef :: binary() | integer()) ->
               ok | {jarl_error, not_connected}.

request(Conn, Method, Params)

-spec request(Conn :: pid(), Method :: jarl:method(), Params :: map()) ->
                 {result, Result :: term()} |
                 {error, Code :: integer(), Message :: undefined | binary(), ErData :: term()} |
                 {jarl_error, timeout} |
                 {jarl_error, not_connected}.

request(Conn, Method, Params, ReqCtx)

-spec request(Conn :: pid(), Method :: jarl:method(), Params :: map(), ReqCtx :: term()) ->
                 ok | {jarl_error, Reason :: jarl:jarl_error_reason()}.

start_link(Handler, Options)

-spec start_link(Handler :: pid(), Options :: jarl:start_options()) ->
                    {ok, Conn :: pid()} | {error, Reason :: term()}.

terminate(Reason, State, Data)