> ## Documentation Index
> Fetch the complete documentation index at: https://abxbus.archivebox.io/llms.txt
> Use this file to discover all available pages before exploring further.

# WALEventBusMiddleware

> Persist completed events to a JSONL write-ahead log.

`WALEventBusMiddleware` appends completed event snapshots to a JSONL file.

## Constructor params

* `wal_path`: filesystem path for append-only JSONL output

## Setup with EventBus

<Tabs>
  <Tab title="Python">
    ```python theme={null}
    from abxbus import EventBus
    from abxbus.middlewares import WALEventBusMiddleware

    bus = EventBus(
        name='AppBus',
        middlewares=[WALEventBusMiddleware('./events.jsonl')],
    )
    ```
  </Tab>

  <Tab title="Rust">
    ```rust theme={null}
    // Not implemented in the Rust crate yet.
    // Use explicit typed handler wrappers around bus.on(...) for this behavior for now.
    ```
  </Tab>
</Tabs>

## Behavior

* Writes one JSON line per completed event.
* Uses internal locking for thread-safe file appends.
* Creates parent directories automatically.
* Intended for replay/debug/audit workflows.
