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

# Overview

> Unified docs for abxbus Python, TypeScript, Rust, and Go implementations.

## `abxbus`: Production-ready multi-language event bus

<img width="200" alt="abxbus logo" src="https://github.com/user-attachments/assets/b3525c24-51ba-496c-b327-ccdfe46a7362" align="right" />

[![DeepWiki: Python](https://img.shields.io/badge/DeepWiki-abxbus%2FPython-yellow.svg?logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACwAAAAyCAYAAAAnWDnqAAAAAXNSR0IArs4c6QAAA05JREFUaEPtmUtyEzEQhtWTQyQLHNak2AB7ZnyXZMEjXMGeK/AIi+QuHrMnbChYY7MIh8g01fJoopFb0uhhEqqcbWTp06/uv1saEDv4O3n3dV60RfP947Mm9/SQc0ICFQgzfc4CYZoTPAswgSJCCUJUnAAoRHOAUOcATwbmVLWdGoH//PB8mnKqScAhsD0kYP3j/Yt5LPQe2KvcXmGvRHcDnpxfL2zOYJ1mFwrryWTz0advv1Ut4CJgf5uhDuDj5eUcAUoahrdY/56ebRWeraTjMt/00Sh3UDtjgHtQNHwcRGOC98BJEAEymycmYcWwOprTgcB6VZ5JK5TAJ+fXGLBm3FDAmn6oPPjR4rKCAoJCal2eAiQp2x0vxTPB3ALO2CRkwmDy5WohzBDwSEFKRwPbknEggCPB/imwrycgxX2NzoMCHhPkDwqYMr9tRcP5qNrMZHkVnOjRMWwLCcr8ohBVb1OMjxLwGCvjTikrsBOiA6fNyCrm8V1rP93iVPpwaE+gO0SsWmPiXB+jikdf6SizrT5qKasx5j8ABbHpFTx+vFXp9EnYQmLx02h1QTTrl6eDqxLnGjporxl3NL3agEvXdT0WmEost648sQOYAeJS9Q7bfUVoMGnjo4AZdUMQku50McDcMWcBPvr0SzbTAFDfvJqwLzgxwATnCgnp4wDl6Aa+Ax283gghmj+vj7feE2KBBRMW3FzOpLOADl0Isb5587h/U4gGvkt5v60Z1VLG8BhYjbzRwyQZemwAd6cCR5/XFWLYZRIMpX39AR0tjaGGiGzLVyhse5C9RKC6ai42ppWPKiBagOvaYk8lO7DajerabOZP46Lby5wKjw1HCRx7p9sVMOWGzb/vA1hwiWc6jm3MvQDTogQkiqIhJV0nBQBTU+3okKCFDy9WwferkHjtxib7t3xIUQtHxnIwtx4mpg26/HfwVNVDb4oI9RHmx5WGelRVlrtiw43zboCLaxv46AZeB3IlTkwouebTr1y2NjSpHz68WNFjHvupy3q8TFn3Hos2IAk4Ju5dCo8B3wP7VPr/FGaKiG+T+v+TQqIrOqMTL1VdWV1DdmcbO8KXBz6esmYWYKPwDL5b5FA1a0hwapHiom0r/cKaoqr+27/XcrS5UwSMbQAAAABJRU5ErkJggg==)](https://deepwiki.com/ArchiveBox/abxbus) [![PyPI - Version](https://img.shields.io/pypi/v/abxbus)](https://pypi.org/project/abxbus/) [![NPM Version](https://img.shields.io/npm/v/abxbus)](https://www.npmjs.com/package/abxbus) [![GitHub License](https://img.shields.io/github/license/ArchiveBox/abxbus)](https://github.com/ArchiveBox/abxbus)

AbxBus is an in-memory event bus for async Python, TypeScript (Node and browser environments), Rust, and Go, built for predictable event-driven workflows with strong typing and consistent cross-language behavior.

Core strengths:

* Typed event payloads and typed handler return values
* Deterministic queue semantics with configurable concurrency
* Nested event lineage tracking (`event_parent_id` / `event_path`)
* Event forwarding, bridge transports, and middleware integration

## Minimal usage

<Tabs>
  <Tab title="Python">
    ```python theme={null}
    from abxbus import BaseEvent, EventBus

    class SomeEvent(BaseEvent):
        some_data: int

    async def on_some_event(event: SomeEvent) -> None:
        print(event.some_data)
        # 132

    bus = EventBus('MyBus')
    bus.on(SomeEvent, on_some_event)

    await bus.emit(SomeEvent(some_data=132)).now()
    ```
  </Tab>

  <Tab title="TypeScript">
    ```ts theme={null}
    import { BaseEvent, EventBus } from "abxbus";
    import { z } from "zod";

    const SomeEvent = BaseEvent.extend("SomeEvent", {
      some_data: z.number(),
    });

    const bus = new EventBus("MyBus");
    bus.on(SomeEvent, async (event) => {
      console.log(event.some_data);
    });

    await bus.emit(SomeEvent({ some_data: 132 })).now();
    ```
  </Tab>

  <Tab title="Rust">
    ```rust theme={null}
    use abxbus::{event, event_bus::EventBus};
    use futures::executor::block_on;

    event! {
        struct SomeEvent {
            some_data: i64,
            event_result_type: String,
        }
    }

    let bus = EventBus::new(Some("MyBus".to_string()));
    bus.on(SomeEvent, |event: SomeEvent| async move {
        Ok(format!("did something with {}", event.some_data))
    });

    let event = bus.emit(SomeEvent { some_data: 132, ..Default::default() });
    block_on(event.now())?;
    ```
  </Tab>

  <Tab title="Go">
    ```go theme={null}
    package main

    import (
    	"fmt"

    	abxbus "github.com/ArchiveBox/abxbus/abxbus-go"
    )

    func main() {
    	type SomeEvent struct {
    		SomeData int `json:"some_data"`
    	}

    	bus := abxbus.NewEventBus("MyBus", nil)
    	bus.On(func(event SomeEvent) {
    		fmt.Println(event.SomeData)
    	})

    	event := bus.Emit(SomeEvent{SomeData: 132})
    	_, _ = event.Now()
    }
    ```
  </Tab>
</Tabs>

See [Quickstart](./quickstart) for installation and first full example.

## Repository examples

Runnable end-to-end examples and implementation smoke tests live in the repo:

* Quickstart basics:
  * [`examples/simple.py`](https://github.com/ArchiveBox/abxbus/blob/main/examples/simple.py)
  * [`abxbus-ts/examples/simple.ts`](https://github.com/ArchiveBox/abxbus/blob/main/abxbus-ts/examples/simple.ts)
* Concurrency modes, overrides, and timeout behavior:
  * [`examples/concurrency_options.py`](https://github.com/ArchiveBox/abxbus/blob/main/examples/concurrency_options.py)
  * [`abxbus-ts/examples/concurrency_options.ts`](https://github.com/ArchiveBox/abxbus/blob/main/abxbus-ts/examples/concurrency_options.ts)
* Immediate execution (queue-jump) behavior:
  * [`examples/immediate_event_processing.py`](https://github.com/ArchiveBox/abxbus/blob/main/examples/immediate_event_processing.py)
  * [`abxbus-ts/examples/immediate_event_processing.ts`](https://github.com/ArchiveBox/abxbus/blob/main/abxbus-ts/examples/immediate_event_processing.ts)
* Forwarding between buses:
  * [`examples/forwarding_between_busses.py`](https://github.com/ArchiveBox/abxbus/blob/main/examples/forwarding_between_busses.py)
  * [`abxbus-ts/examples/forwarding_between_busses.ts`](https://github.com/ArchiveBox/abxbus/blob/main/abxbus-ts/examples/forwarding_between_busses.ts)
* Parent-child lineage tracking:
  * [`examples/parent_child_tracking.py`](https://github.com/ArchiveBox/abxbus/blob/main/examples/parent_child_tracking.py)
  * [`abxbus-ts/examples/parent_child_tracking.ts`](https://github.com/ArchiveBox/abxbus/blob/main/abxbus-ts/examples/parent_child_tracking.ts)
* Tree logs with nested timeout outcomes:
  * [`examples/log_tree_demo.py`](https://github.com/ArchiveBox/abxbus/blob/main/examples/log_tree_demo.py)
  * [`abxbus-ts/examples/log_tree_demo.ts`](https://github.com/ArchiveBox/abxbus/blob/main/abxbus-ts/examples/log_tree_demo.ts)
* Rust parity and roundtrip tests:
  * [`abxbus-rust/tests/test_comprehensive_patterns.rs`](https://github.com/ArchiveBox/abxbus/blob/main/abxbus-rust/tests/test_comprehensive_patterns.rs)
  * [`abxbus-rust/tests/test_cross_runtime_roundtrip.rs`](https://github.com/ArchiveBox/abxbus/blob/main/abxbus-rust/tests/test_cross_runtime_roundtrip.rs)
* Go parity and roundtrip helper:
  * [`abxbus-go/tests/comprehensive_patterns_test.go`](https://github.com/ArchiveBox/abxbus/blob/main/abxbus-go/tests/comprehensive_patterns_test.go)
  * [`abxbus-go/tests/roundtrip_cli`](https://github.com/ArchiveBox/abxbus/blob/main/abxbus-go/tests/roundtrip_cli/main.go)
