View Source FLHook.Client (FLHook Client v1.0.0)
A GenServer that connects to a FLHook socket.
Link to this section Summary
Functions
The child specification for a FLHook client.
Closes the connection.
Sends a command to the socket and returns the result.
Sends a command to the socket and returns the result. Raises on error.
Indicates whether the socket is connected.
Opens the connection.
Starts the FLHook client using the given config or options.
Starts the FLHook client using the given config and options.
Registers the specified process as event listener.
Removes the event listener for the specified process.
Link to this section Types
Specs
client() :: GenServer.server()
Type representing a FLHook client process.
Link to this section Functions
Specs
child_spec(term()) :: Supervisor.child_spec()
The child specification for a FLHook client.
Specs
close(client()) :: :ok
Closes the connection.
Specs
cmd(client(), FLHook.command()) :: {:ok, FLHook.Result.t()} | {:error, Exception.t()}
Sends a command to the socket and returns the result.
Specs
cmd!(client(), FLHook.command()) :: FLHook.Result.t() | no_return()
Sends a command to the socket and returns the result. Raises on error.
Specs
Indicates whether the socket is connected.
Specs
open(client()) :: :ok | {:error, Exception.t()}
Opens the connection.
Specs
start_link(FLHook.Config.t() | Keyword.t()) :: GenServer.on_start()
Starts the FLHook client using the given config or options.
Specs
start_link(FLHook.Config.t(), GenServer.options()) :: GenServer.on_start()
Starts the FLHook client using the given config and options.
Specs
subscribe(client(), GenServer.server()) :: :ok
Registers the specified process as event listener.
Specs
unsubscribe(client(), GenServer.server()) :: :ok
Removes the event listener for the specified process.