Skip to content

Latest commit

Β 

History

History
340 lines (255 loc) Β· 13.2 KB

File metadata and controls

340 lines (255 loc) Β· 13.2 KB

Changelog

v0.16.2 (2026-01-24)

Fixes

  • notify addr of stop when handler panics (1cbad97)

v0.16.1 (2026-01-19)

Fixes

  • reference correct new setup function (ca5c5b2)

v0.16.0 (2026-01-19)

⚠ BREAKING CHANGE

  • Builder interface simplified and renamed

The builder API has been simplified and renamed for clarity and flexibility. Configuration methods can now be called in any order.

Renamed:

  • hannibal::build() β†’ hannibal::setup()
  • Added .setup_actor() method on all actors (via the Configurable trait)

Removed methods and their replacements:

  1. .with_stream(stream) β†’ use .on_stream(stream)

    ❌ Before:

    hannibal::build(actor)
        .unbounded()
        .non_restartable()
        .with_stream(stream)
        .spawn()

    βœ… Now (any order works):

    hannibal::setup(actor)
        .on_stream(stream)
        .unbounded()
        .spawn()
    
    // or use the trait method
    actor
        .setup_actor()
        .unbounded()
        .on_stream(stream)
        .spawn()
  2. .bounded_on_stream(capacity, stream) β†’ use .bounded(capacity).on_stream(stream)

    ❌ Before:

    hannibal::build(actor)
        .bounded_on_stream(10, stream)
        .spawn()

    βœ… Now (any order works):

    hannibal::setup(actor)
        .bounded(10)
        .on_stream(stream)
        .spawn()
    
    // or
    hannibal::setup(actor)
        .on_stream(stream)
        .bounded(10)
        .spawn()
  3. .non_restartable() β†’ removed (no longer needed)

    Stream-attached actors are automatically non-restartable. For non-stream actors, simply don't call .recreate_from_default().

Migration:

  • Replace all hannibal::build() calls with hannibal::setup()
  • Or use the new actor.setup_actor() method
  • Remove .with_stream(), .bounded_on_stream(), and .non_restartable() calls
  • Use .on_stream() and other config methods in any order you prefer

Benefits:

  • More flexible: configuration methods can be called in any order
  • Less API surface: fewer methods to remember
  • Clearer naming: setup() and .setup_actor() are consistent
  • More intuitive: .on_stream() is more descriptive than .with_stream()
  • this introduces new error variants
  • The ActorError enum is now marked as non-exhaustive.

Features

  • simplify builder (3f46d30)
  • make error types a bit more distinct (059c732)

Fixes

  • avoid a few race conditions more (bb1ab20)
  • avoid a few race conditions (a5e72dc)
  • mark error as non-exhaustive (1094fa8)

v0.15.1 (2026-01-06)

Features

  • enable sub-task garbage collection (1fdfef9)
  • add cleanup_children method to Context (7e62ea5)

v0.15.0 (2025-12-13)

⚠ BREAKING CHANGE

  • from now on StreamHandling Actors do not automatically stop when the stream is finished

If you want your Actor to stop when the attached stream is finished you need to call stop in the finished function:

impl StreamHandler<i32> for FizzBuzzer {
    async fn finished(&mut self, ctx: &mut Context<Self>) {
        ctx.stop().unwrap();
    }
}

Fixes

  • unable to publish from actor unless actor is also Handler, not needed (67dbd4b)
  • correctly handle finished streams (9dbc19e)

v0.14.2 (2025-12-07)

Features

  • add running and stopped methods to weak and strong Addr, Sender and Caller (22cf287)

v0.14.1 (2025-12-01)

Features

  • add sync try_send() to Sender (f1a0edc)

v0.14.0 (2025-11-30)

⚠ BREAKING CHANGE

  • renamed try_send of WeakSender to upgrade_and_send() clarity

Features

  • add sync try_send() to Addr (d31c7a0)

Fixes

  • Context::weak_addr returns no more Option (9ec9561)
  • avoid tick overload by cancelling interval ticks when they exceed their time quota (457f538)
  • properly detach task when spawning with a stream (dc5803f)
  • make it possible to use derive macros internally (c89197f)
  • use tokio spawn for sub-tasks when tokio_runtime is enabled (f84655b)

v0.13.2 (2025-10-05)

Features

  • restructure the builder module and improve documentation (76d7d07)

v0.13.1 (2025-09-25)

Fixes

v0.13.0 (2025-08-14)

Fixes

  • remove unused async-std and smol dependency (32f90dc)

v0.12.5 (2025-08-09)

Features

  • add stop_task function to be able to stop intervals etc (c9a591d)
  • add task spawning capability to Actor context (bb509e0)

v0.12.4 (2025-07-28)

Fixes

  • correct unristering api (9ea847f)

v0.12.3 (2025-07-25)

Fixes

  • support generics in Actor derive macro (aedb03d)

v0.12.2 (2025-05-03)

Features

  • add callback for when the actor is cancelled (0db25bd)

Fixes

  • only call finished if the stream actually finished (0f8e9f3)
  • enforce timeouts in stream loop (2f084ca)

v0.12.1 (2025-05-03)

Fixes

v0.12.0 (2025-04-27)

Features

  • support for sending messages to child actors (1e61bf3)
  • support for sending messages to child actors (fd9f3f4)
  • support smol runtime (e4f5b1f)
  • replace concrete tokio::main with own agnostic main attribute (6dd6758)
  • add delayed_exec() helper to context (95d4550)
  • add try_stop() and try_halt() helpers to WeakAddr (84674ee)
  • add address to context (0a54839)
  • rename to hannibal (88d5b8f)
  • add convenience methods to builders (bc3a15d)
  • add .call(), .send() and .ping() to OwningAddr (5739810)
  • add .consume() to OwningAddr (46f06b1)
  • add .ping() to Addr (d281452)
  • implement macros (e5ce024)
  • add actor names and logging (06909fd)
  • add broker (61694d4)
  • expose OwningAddr (730c39a)
  • add intervals and delayed_send (ade415e)
  • add timeouting (11c71b8)
  • add OwningAddr (e440a84)
  • fail registering service if there is already one running (83b7b7e)
  • add builder (afda883)
  • add NonRestartable (757b1ed)
  • add holding children in context (6d35f6b)
  • make Addr::restart() dependent on the Actor implementing a marker trait (99bcab5)
  • add SpawnableService trait (64d9de6)
  • call finished on streamhandler when stream is done (754ebfa)
  • add service trait (7f9a979)
  • add Spawnable trait to start actors (9ea6e79)
  • add restart strategies for actors (a53c1b8)
  • add distinct StreamHandler trait (a7c57c0)
  • stream handling (355d636)
  • add helper methods to create Senders and Callers (a195950)
  • add WeakAddr (1227e63)
  • add callers and senders weak and strong (374e593)
  • support actor mutability (b46a4c1)
  • up and downgrading (6c4133e)
  • minimalist actor framework in 150 lines (5160ce0)

Fixes