Tungsten v0.1.0 Tungsten.Connection View Source
Manages the connection to a browser
Connection is responsible for keeping track of the CDP command id that is
used to keep track of in-flight commands.
Link to this section Summary
Types
An error as result of a CDP command
Represents a CDP 'frame', the raw message data sent over the transport
The result from a CDP command
Option values used by exec_* functions
Options used by exec_* functions
Option values used by start_* functions
Options used by start_* functions
Type of the struct that keeps the connection's internal state
Functions
Returns a specification to start this module under a supervisor.
Executes a command synchronously.
Starts the Connection and connects to the configured transport.
Link to this section Types
cdp_error()
View Source
cdp_error() :: map()
cdp_error() :: map()
An error as result of a CDP command
cdp_frame()
View Source
cdp_frame() :: map()
cdp_frame() :: map()
Represents a CDP 'frame', the raw message data sent over the transport
cdp_result()
View Source
cdp_result() :: map()
cdp_result() :: map()
The result from a CDP command
exec_option() View Source
Option values used by exec_* functions
exec_options()
View Source
exec_options() :: [exec_option()]
exec_options() :: [exec_option()]
Options used by exec_* functions
option()
View Source
option() :: GenServer.option() | {:transport, keyword()}
option() :: GenServer.option() | {:transport, keyword()}
Option values used by start_* functions
options()
View Source
options() :: [option()]
options() :: [option()]
Options used by start_* functions
state()
View Source
state() :: %Tungsten.Connection{
callbacks: %{optional(non_neg_integer()) => GenServer.from()},
id: non_neg_integer(),
transport: GenServer.server() | nil
}
state() :: %Tungsten.Connection{
callbacks: %{optional(non_neg_integer()) => GenServer.from()},
id: non_neg_integer(),
transport: GenServer.server() | nil
}
Type of the struct that keeps the connection's internal state
Link to this section Functions
child_spec(init_arg) View Source
Returns a specification to start this module under a supervisor.
See Supervisor.
exec(connection, method, parameters, options \\ [])
View Source
exec(GenServer.server(), String.t(), map(), exec_options()) ::
{:ok, cdp_result(), cdp_frame()} | {:error, cdp_error(), cdp_frame()}
exec(GenServer.server(), String.t(), map(), exec_options()) :: {:ok, cdp_result(), cdp_frame()} | {:error, cdp_error(), cdp_frame()}
Executes a command synchronously.
Options:
:timeout- an integer greater than zero which specifies how many milliseconds to wait for a reply, or the atom :infinity to wait indefinitely. The default value is5000.
start_link(options)
View Source
start_link(options()) :: GenServer.on_start()
start_link(options()) :: GenServer.on_start()
Starts the Connection and connects to the configured transport.