View Source XtbClient.StreamingSocket (XtbClient v0.1.0)
WebSocket server used for asynchronous communication.
StreamingSocket is being used like standard GenServer - could be started with start_link/1 and supervised.
After successful connection to WebSocket the flow is:
- process schedules to itself the
pingcommand (with recurring interval) - to maintain persistent connection with backend.
Link to this section Summary
Functions
Starts a XtbClient.StreamingSocket process linked to the calling process.
Subscribes pid process for messages from method query.
Link to this section Types
Link to this section Functions
@spec start_link(%{ :stream_session_id => binary(), :type => XtbClient.AccountType.t(), :url => binary() | URI.t(), optional(any()) => any() }) :: GenServer.on_start()
Starts a XtbClient.StreamingSocket process linked to the calling process.
Subscribes pid process for messages from method query.
arguments
Arguments
clientpid of the streaming socket process,pidpid of the caller awaiting for the result,refunique reference of the query,methodname of the query method,params[optional] arguments of themethod.
Result of the query will be delivered to message mailbox of the pid process.