State and business logic for the :windowed session pool mode.
Windowed tests run one renderer process per logical session. This module owns per-session state, request tracking, response dispatch, and exit handling for those renderer processes.
Summary
Types
How the pool is waiting for a windowed renderer to exit.
Request identifier attached to a message sent to the renderer.
Internal session identifier assigned by SessionPool.
Per-session state for a windowed renderer process.
Types
@type close_kind() :: {:sync, GenServer.from()} | :async
How the pool is waiting for a windowed renderer to exit.
@type request_id() :: String.t()
Request identifier attached to a message sent to the renderer.
@type session_id() :: String.t()
Internal session identifier assigned by SessionPool.
@type t() :: %Plushie.Test.SessionPool.Windowed{ buffer: binary(), owner_pid: pid(), owner_ref: reference(), pending: %{required(request_id()) => {String.t(), GenServer.from()}}, port: port() }
Per-session state for a windowed renderer process.
Functions
@spec find_close_by_port(%{required(session_id()) => t()}, map(), port()) :: {session_id(), t()} | nil
@spec find_session_by_port(%{required(session_id()) => t()}, port()) :: {session_id(), t()} | nil
@spec finish_exit(Plushie.Test.SessionPool.t(), session_id(), t(), integer()) :: Plushie.Test.SessionPool.t()
@spec handle_port_data( binary() | {:eol, binary()}, session_id(), t(), Plushie.Test.SessionPool.Transport.format() ) :: t()
@spec register_session(Plushie.Test.SessionPool.t(), pid(), reference(), session_id()) :: Plushie.Test.SessionPool.t()
@spec request_exit(Plushie.Test.SessionPool.t(), session_id(), port(), close_kind()) :: Plushie.Test.SessionPool.t()
@spec send_async(t(), map(), Plushie.Test.SessionPool.Transport.format()) :: t()
@spec send_interact( t(), map(), request_id(), Plushie.Test.SessionPool.Transport.format() ) :: t()
@spec send_sync( t(), map(), request_id(), String.t(), GenServer.from(), Plushie.Test.SessionPool.Transport.format() ) :: t()