> ## 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.

# JSONLEventBridge

> Forward events through newline-delimited JSON files.

`JSONLEventBridge` appends one event JSON payload per line and tails the file for inbound events.

## Constructor params

* `path`: JSONL file path
* `poll_interval`: tail polling interval in seconds (default `0.25`)
* `name`: optional bridge label

> [tab] Python
>
> ```python theme={null}
> from abxbus.bridges import JSONLEventBridge
>
> bridge = JSONLEventBridge(
>     '/tmp/abxbus_events.jsonl',
>     poll_interval=0.25,
>     name='JsonlBridge',
> )
> ```

> [tab] TypeScript
>
> ```ts theme={null}
> import { JSONLEventBridge } from 'abxbus/bridges'
>
> const bridge = new JSONLEventBridge('/tmp/abxbus_events.jsonl', 0.25, 'JsonlBridge')
> ```

> [tab] Go
>
> ```go theme={null}
> bridge := abxbus.NewJSONLEventBridge("/tmp/abxbus_events.jsonl", 0.25, "JsonlBridge")
> ```

> [tab] Rust
>
> ```rust theme={null}
> // Not implemented in the Rust crate yet.
> // Use typed event JSON serialization with an external transport for now.
> ```

## Setup with a bus

> [tab] Python
>
> ```python theme={null}
> from abxbus import EventBus
> from abxbus.bridges import JSONLEventBridge
>
> bus = EventBus('AppBus')
> bridge = JSONLEventBridge('/tmp/abxbus_events.jsonl')
>
> bus.on('*', bridge.emit)
> bridge.on('*', bus.emit)
> ```

> [tab] TypeScript
>
> ```ts theme={null}
> import { EventBus } from 'abxbus'
> import { JSONLEventBridge } from 'abxbus/bridges'
>
> const bus = new EventBus('AppBus')
> const bridge = new JSONLEventBridge('/tmp/abxbus_events.jsonl')
>
> bus.on('*', bridge.emit)
> bridge.on('*', bus.emit)
> ```

> [tab] Go
>
> ```go theme={null}
> bus := abxbus.NewEventBus("AppBus", nil)
> bridge := abxbus.NewJSONLEventBridge("/tmp/abxbus_events.jsonl", 0.25, "JsonlBridge")
>
> bus.OnEventName("*", "jsonl_emit", func(event *abxbus.BaseEvent) (any, error) {
> 	return bridge.Emit(event)
> }, nil)
> bridge.OnEventName("*", "bus_emit", func(event *abxbus.BaseEvent) (any, error) {
> 	return bus.Emit(event), nil
> }, nil)
> ```

> [tab] Rust
>
> ```rust theme={null}
> // Not implemented in the Rust crate yet.
> // Use typed events plus EventBus JSON serialization with an external transport for now.
> ```

## Behavior

* `emit(...)` appends compact JSON payload + newline to the file.
* `on(...)` auto-starts a tail loop and registers inbound handlers.
* Start cursor is initialized at current EOF, so only newly appended lines are processed.
* Malformed lines are ignored; valid lines are parsed into events, reset, and emitted on the internal bus.
* Runtime note: TypeScript JSONL bridge is Node.js-only. Go's JSONL bridge uses local filesystem polling.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.