Jido.Browser.Session (Jido Browser v2.1.0)

Copy Markdown View Source

Represents an active browser session.

A session holds the connection state to a browser instance and tracks the adapter being used for communication.

Summary

Functions

Creates a new session struct.

Like new/1 but raises on validation errors.

Returns the Zoi schema for this struct.

Types

t()

@type t() :: %Jido.Browser.Session{
  adapter: module(),
  capabilities: map(),
  connection: term(),
  id: String.t(),
  opts: map(),
  runtime: map() | nil,
  started_at: DateTime.t()
}

Functions

new(attrs)

@spec new(map()) :: {:ok, t()} | {:error, term()}

Creates a new session struct.

Examples

session = Jido.Browser.Session.new!(
  id: "sess_abc123",
  adapter: Jido.Browser.Adapters.Vibium,
  connection: pid
)

new!(attrs)

@spec new!(map()) :: t()

Like new/1 but raises on validation errors.

schema()

@spec schema() :: Zoi.schema()

Returns the Zoi schema for this struct.