SnakeBridge.StreamRef (SnakeBridge v0.15.1)

Copy Markdown View Source

Represents a Python iterator or generator as an Elixir stream.

Implements the Enumerable protocol for lazy iteration.

Summary

Functions

Creates a StreamRef from a decoded wire format.

Converts back to wire format for Python calls.

Types

t()

@type t() :: %SnakeBridge.StreamRef{
  exhausted: boolean(),
  library: String.t(),
  pool_name: String.t() | atom() | nil,
  python_module: String.t(),
  ref_id: String.t(),
  session_id: String.t(),
  stream_type: String.t()
}

Functions

from_wire_format(map)

@spec from_wire_format(map()) :: t()

Creates a StreamRef from a decoded wire format.

to_wire_format(ref)

@spec to_wire_format(t()) :: map()

Converts back to wire format for Python calls.