# `ZenWebsocket.Client.CallFacade`
[🔗](https://github.com/ZenHive/zen_websocket/blob/v0.8.0/lib/zen_websocket/client/call_facade.ex#L1)

Process-down-safe GenServer.call helpers used by `ZenWebsocket.Client`.

Touches no Gun state. Every public Client accessor that talks to the
connection process goes through `safe_call/3`.

# `process_down_exit?`

```elixir
@spec process_down_exit?(term()) :: boolean()
```

True when a `GenServer.call/2` exit means the target process is gone.

# `safe_call`

```elixir
@spec safe_call(pid(), term(), term()) :: term()
```

`GenServer.call/2` that returns `fallback` when the server process is down.

# `start_client`

```elixir
@spec start_client(module(), ZenWebsocket.Config.t(), keyword(), (map(), pid() -&gt;
                                                              struct())) ::
  {:ok, struct()} | {:error, term()}
```

Starts the Client GenServer, installs the default parent handler when
none is provided, and awaits the WebSocket upgrade.

# `unwrap_call_exit`

```elixir
@spec unwrap_call_exit(term()) :: term()
```

Unwraps a `GenServer.call/3` exit into the error reason returned to callers.

# `with_default_handler`

```elixir
@spec with_default_handler(
  keyword(),
  pid()
) :: keyword()
```

Adds a parent-process message handler when `:handler` is absent from `opts`.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
