Skip to content

v0.16.0

Latest
Compare
Choose a tag to compare
@tqwewe tqwewe released this 28 Mar 13:49
· 11 commits to main since this release
fa070cf

Kameo 0.16 has been released, and brings some much needed simplicity to to library.

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

And thanks to our new contributors:

Breaking Changes

Removed Mailbox Generics and Request Traits

The actor trait no longer has a type Mailbox associated type.
Instead, the mailbox is specified when spawning the actor using the spawn_with_mailbox functions.

By default, actors are spawned using bounded mailboxes with a capactiy of 64.

This change also removes the BoundedMailbox and UnboundedMailbox types, and the Mailbox trait,
and replaces it all with an enum over tokio's mpsc bounded & unbounded types.
The new types are MailboxSender, MailboxReceiver, WeakMailboxReceiver.

Removes the request traits (MessageSend, TryMessageSend, etc)

There's no longer the request traits, and instead .send(), .try_send(), .blocking_send() are called directly on the request types rather than as trait implementations.

This is a huge improvement from a simplicity perspective, as many complicated trait bounds were the cause of the mailbox flexibility.

How do we call .send_sync() and .try_send_sync()?

These methods were only available on unbounded mailboxes.
This can still be achieved by using .now_or_never() on the request,
however bounded mailboxes may return None here.

One major downside of course is that custom mailbox types can no longer be used,
since they're hard coded enum variants within kameo instead of a trait implementation.
However, the existing Mailbox trait is already very specific, and other mailbox types couldn't
even be implemented due to some features missing in other asynchronous channel types.

Added

  • Add prelude module (#145)
  • Add Actor::next method (#147)
  • Add on_message function to Actor trait (#155)

Changed

  • BREAKING: Use ForwardMessageSend trait for Context::forward methods (#146)
  • BREAKING: Move pool and pubsub actors into new kameo_actors crate (#154)

Removed

  • BREAKING: Remove mailbox generics and request traits (#153)
  • Remove unnecessary trait bound in Context::forward method </>

Fixed

  • Spawn with tokio unstable cfg flags </>

Documentation

  • Bump version in getting started page </>
  • Remove unnecessary tokio time sleep import in code docs </>
  • Add vanhouc sponsor to README.md </>
  • Fix sponsor badge link </>
  • Impove registerering and looking up actors example </>

Misc

  • Fix clippy lints (#149)
  • Ci updates </>
  • Improve ci and run in parallel (#156)
  • Add release scripts </>
  • Bump kameo_macros to version 0.16.0 </>

See the full CHANGELOG.md