Download Latest Version v0.17.2 source code.tar.gz (578.2 kB)
Email in envelope

Get an email when there's a new version of Kameo

Home / v0.17.0
Name Modified Size InfoDownloads / Week
Parent folder
README.md 2025-06-22 4.6 kB
v0.17.0 source code.tar.gz 2025-06-22 577.8 kB
v0.17.0 source code.zip 2025-06-22 613.7 kB
Totals: 3 Items   1.2 MB 0

Kameo 0.17 has been released, with some flexibility improvements to the API.

A huge thank you to Huly Labs, Caido Community, vanhouc, cawfeecoder for supporting Kameo's development! 💖

And thanks to our new contributors:

  • @Malefaro made their first contribution in [#179]

  • @hanekoo made their first contribution in [#163]

  • @Avi-D-coder made their first contribution in [#170]

  • @artemijan made their first contribution in [#177]

Highlighted Changes

Add Actor::Args associated type and actor spawn methods (#168)

New Actor::Args associated type

A new Args type is added to the Actor trait, allowing the actors state to be initialized in the on_start method.

Unfortunately this makes the on_start method required, since it cannot have a default implementation. But the #[derive(Actor)] macro just sets the Args = Self, and returns the state in the implementation.

Actor spawn methods

The spawn functions have been moved to be part of the Actor trait directly.

This means instead of kameo::spawn(MyActor), you now use MyActor::spawn(MyActor). This looks a little redundant, however the args passed to MyActor::spawn(args) can now be a different type to the actor itself, allowing some powerful patterns.

The spawn methods available are now:

  • Actor::spawn
  • Actor::spawn_with_mailbox
  • Actor::spawn_link
  • Actor::spawn_link_with_mailbox
  • Actor::spawn_in_thread
  • Actor::spawn_in_thread_with_mailbox
  • Actor::prepare
  • Actor::prepare_with_mailbox

For the methods not suffixed with _with_mailbox, the default mailbox is a bounded with a capacity of 64.

Add Recipient and ReplyRecipient types for type erased actor refs (#160, [#179])

ActorRefs can be "downgraded" into new type erased types Recipient<M> and ReplyRecipient<M, R, E> using the new .recipient() and .reply_recipient() methods.

This allows you to erase the actors type itself, and in exchange have a recipient which can only handle messages of a single type.

New Broker and MessageBus actors

The kameo_actors crate now has two new actors: Broker, and MessageBus.

Add actor shutdown result handling and error hook (#166)

Adds a new wait_for_shutdown_result method to ActorRef, for handling errors during shutdown. Additionally, exposes a kameo::error::set_actor_error_hook function for setting a global function to be called when an actor's on_start or on_stop methods return an error.


Added

  • BREAKING: Add Recipient type for type erased actor refs (#160)
  • BREAKING: Add Actor::Args associated type and actor spawn methods (#168)
  • Add Recipient and WeakRecipient to prelude
  • Add broker actor (#161)
  • Add message bus actor (#162)
  • Add track_caller to Recipient::tell
  • Add actor shutdown result handling and error hook (#166)
  • Implement downgrade for Recipient
  • Add msg and err methods to SendError (#169)
  • Add message_queue actor (#163)
  • Add reply recipient that can do ask requests (#179)

Changed

  • Wrap large enum variant in Box to fix clippy lint
  • Format toml files

Fixed

  • Process buffered messages before stopping gracefully
  • Actors not stopping due to leaked ActorRef

Misc

  • Update criterion requirement from 0.5 to 0.6 (#173)
  • Update release script shabangs
  • Bump kameo_macros to version 0.17.0

See the full [CHANGELOG.md](https://github.com/tqwewe/kameo/blob/main/CHANGELOG.md#0170

Source: README.md, updated 2025-06-22