# `ExAthena.Sessions.Stores.Jsonl`
[🔗](https://github.com/udin-io/ex_athena/blob/v0.7.1/lib/ex_athena/sessions/stores/jsonl.ex#L1)

ETS-buffered JSONL session store.

Hot-path appends go to an in-memory ETS table keyed by monotonic
time so writes never block the loop. A background process flushes
buffered events to JSONL files every 250ms (or immediately when
forced via `flush/1`).

Path: `<root>/<session_id>.jsonl`. `root` defaults to
`<cwd>/.exathena/sessions/`; configurable via the `:root` option
passed to `start_link/1`.

Each JSONL line is one event: `{"ts": "...", "event": "...",
"data": {...}, "uuid": "..."}`.

# `child_spec`

Returns a specification to start this module under a supervisor.

See `Supervisor`.

# `flush`

```elixir
@spec flush(GenServer.server()) :: :ok
```

Force a synchronous flush (for tests + clean shutdown).

# `path_for`

```elixir
@spec path_for(String.t()) :: String.t()
```

Resolved storage path for a session id (for tests + tooling).

# `reset`

```elixir
@spec reset(String.t() | nil) :: :ok
```

Test helper: clear all buffered events + storage root.

# `start_link`

```elixir
@spec start_link(keyword()) :: GenServer.on_start()
```

Options:

  * `:root` (default: `Path.join(File.cwd!(), ".exathena/sessions")`)
  * `:flush_interval_ms` (default 250).
  * `:name` (default `__MODULE__`).

---

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