Search documentation of Plushie

# Plushie.Test.PoolAdapter (Plushie v0.7.2)

Copy Markdown View Source

Iostream adapter that connects a Bridge to one SessionPool session.

Acts as a thin relay between the Bridge's iostream protocol and the SessionPool's multiplexed port. The Bridge handles session_id injection via its `:session_id` option, so this adapter only needs to forward raw bytes in both directions.

The adapter registers a session with the pool and monitors the pool for crashes. Incoming pool events are re-encoded and forwarded to the Bridge as iostream data.

## Summary

### Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

start_link(opts)

Starts a pool adapter and returns `{:ok, pid, session_id}`.

## Functions

# child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See `Supervisor`.

# start_link(opts)

    @spec start_link(keyword()) :: {:ok, pid(), String.t()} | {:error, term()}

Starts a pool adapter and returns `{:ok, pid, session_id}`.

## Options

- `:pool` - the SessionPool server (required)
- `:format` - wire format, `:msgpack` (default) or `:json`