ExTermbox.ProcessManager (ExTermbox v1.1.0)
View SourceManages the lifecycle of the C helper process and the PortHandler GenServer.
Provides functions to:
- Spawn the Port process (
spawn_port_process/2
) - Connect to the socket exposed by the C helper (
connect_socket/1
) - Send commands to the C helper via the Port (
send_command_to_port/2
) - Manage the socket connection (
manage_socket_connection/1
)
Summary
Functions
Uses Port.close to close the port.
Uses :gen_tcp.close for closing the UDS created via :gen_tcp.
Uses Port.command to send data to the port process.
Connects to a Unix Domain Socket at the given path.
Uses :gen_tcp.send for sending data over the UDS connection established with :gen_tcp.connect.
Uses Port.open to start the C port process.
Functions
Uses Port.close to close the port.
Uses :gen_tcp.close for closing the UDS created via :gen_tcp.
Uses Port.command to send data to the port process.
@spec connect_socket(Path.t(), pos_integer()) :: {:ok, :socket.socket()} | {:error, any()}
Connects to a Unix Domain Socket at the given path.
Uses :gen_tcp.send for sending data over the UDS connection established with :gen_tcp.connect.
Uses Port.open to start the C port process.
Opts: [:binary, :exit_status, :nouse_stdio]
- :binary - data is sent/received as binaries
- :exit_status - receive a message when the port exits
- :nouse_stdio - prevent port from interacting with group leader stdio