Releases: tqwewe/kameo
v0.14.0
Kameo 0.14 is here, bringing some nice new features, two new contributors, and two new generous sponsors.
A huge thank you to Huly Labs and Caido Community for supporting Kameo's development! 💖
And thanks to @meowjesty and @Kamil729 for their contributions!
New Features
Deadlock Warnings
Any ask or tell requests which could result in a deadlock will now emit tracing warnings.
An example includes sending a tell
request with .send
instead of .try_send
, which may result in a deadlock if the mailbox is full.
Doing so will print a warning:
At src/lib.rs:277, An actor is sending a blocking
tell
request to itself using a bounded mailbox, which may lead to a deadlock.
A nice feature of these warnings is that they show exactly which line of code the issue comes from, making it easily resolvable.
Note that these warnings are only present in debug builds.
Remote Actor Links
Actors can now be linked together remotely! This means if one actor dies, the other will be notified.
This can be achieved with the new methods:
ActorRef::link_remote
ActorRef::unlink_remote
RemoteActorRef::link_remote
RemoteActorRef::unlink_remote
Additionally, if a peer gets disconnected, any actors with links to that peer will be notified with ActorStopReason::PeerDisconnected
,
making the system robust even if a peer crashes or is disconnected.
ActorRef
's blocking_link
and blocking_unlink
ActorRef
now supports linking and unlinking actors with the new blocking_link
and blocking_unlink
methods for syncrhonous contexts.
Local Actor Registry
Previously actors could be registered and looked up with kameo's remote
feature. But now, this feature is supported for non-remote kameo environments,
providing an easy way to register and lookup actors.
let actor_ref = kameo::spawn(MyActor);
actor_ref.register("my awesome actor")?;
let other_actor_ref = ActorRef::<MyActor>::lookup("my awesome actor")?.unwrap();
assert_eq!(actor_ref.id(), other_actor_ref.id());
Full Control Over Actor Swarm
Configuring or having any sort of control over the underlying libp2p swarm was impossible with kameo.
But now, its very easy and flexible, allowing any kind of custom behaviour to be implemented.
Some new methods when bootstrapping include:
ActorSwarm::bootstrap_with_behaviour
for providing a custom behaviour.ActorSwarm::bootstrap_with_swarm
for providing a custom swarm.ActorSwarm::bootstrap_manual
for extremely manual processing of the actor swarm. (seeexamples/manual_swarm.rs
)
Added
- BREAKING: Add support for manual swarm operations (#111)
- BREAKING: Add local actor registry for non-remote environments (#114)
- BREAKING: Add support for remote actor links (#116)
- Add warnings for potential deadlocks (#87)
- Implement infallible reply for
std::path
types (#96) - Add
blocking_link
andblocking_unlink
methods toActorRef
(#115)
Changed
- BREAKING: Use
kameo::error::Infallible
inReply
derive macro instead of()
- BREAKING: Modularize features and improve conditional compilation (#112)
Removed
- BREAKING: Remove actor state from
PreparedActor
(#99) - BREAKING: Remove deprecated
link_child
,unlink_child
,link_together
, andunlink_together
methods </> - Remove mailbox capacity warning on unbounded mailbox tell requests </>
- Remove itertools dependency and replace repeat_n with std::iter::repeat </>
Fixed
- Fix clippy lints and add to CI
Documentation
- Add Caido Community sponsor to README.md </>
- Remote stars badge from README.md </>
- Add huly labs sponsor to README.md </>
Misc
- Fix release script with current release notes </>
- Add changelog links for new versions </>
- Remove flake.nix and flake.lock </>
See the full CHANGELOG.md
v0.13.0
Added
- Impl
IntoFuture
for requests (#72) - Add public
BoxReplySender
type alias (#70) - Add support for preparing an actor and running it outside a spawned task (#69)
- Add
Context::reply
shorthand method </>
Changed
- BREAKING: Relax request impls to be generic to any mailbox (#71)
- BREAKING: Use owned actor ref in
spawn_with
function (#68)
Fixed
- BREAKING: Startup deadlock on small bounded mailboxes (#84)
- Tokio_unstable compile error in
spawn
</> - Request downcasting and added tests (#85)
Documentation
- Remove reverences to deprecated linking methods (#79)
Misc
See the full CHANGELOG.md
v0.12.2
v0.12.1
v0.12.0
- @shusvr made their first contribution in #60
- @marcaddeo made their first contribution in #47
Added
- Add
ActorRef::wait_startup
method (#63)
Changed
- BREAKING: Make
Links
private (#57) - BREAKING: Move actor pool and pubsub to their own modules (#56)
- BREAKING: Move
ActorIDFromBytesError
toerror
module </> - BREAKING: Move remote actor functionality behind
remote
feature (#60) </> - ActorID and improve documentation (#48)
Documentation
- Remove benchmark from README.md </>
- Add contributors badge to README.md </>
- Add Discord badge to README.md </>
- Add book badge to README.md </>
- Add getting help section to README.md </>
- Improve README with use cases, additional resources, and clearer structure </>
- Add support section to README.md </>
- Add Distributed Actor Communication section to README.md </>
- Improve code docs for remote module </>
- Add in-depth distributed actors information to kameo book (#51)
- Update heading levels in book </>
- Improve code docs and examples with all tests passing (#54)
- Add FAQ to book (#59)
Misc
- Add links to README badges (#47)
- Add gtag to kameo book (#52)
- Add Github CI </>
- Remote beta and nightly toolchains from CI </>
- Create CODE_OF_CONDUCT.md </>
- Add CONTRIBUTING.md </>
- Add github issue templates </>
- Move banner.png into docs directory </>
- Add .envrc to .gitignore </>
- Add pr detection to git cliff contributors </>
See the full CHANGELOG.md
v0.12.0-alpha.1
[0.12.0-alpha.1] - 2024-10-09
- @shusvr made their first contribution in #60
- @marcaddeo made their first contribution in #47
Changed
- BREAKING: Make
Links
private (#57) - BREAKING: Move actor pool and pubsub to their own modules (#56)
- BREAKING: Move
ActorIDFromBytesError
toerror
module </> - BREAKING: Move remote actor functionality behind
remote
feature (#60) </> - ActorID and improve documentation (#48)
Documentation
- Remove benchmark from README.md </>
- Add contributors badge to README.md </>
- Add Discord badge to README.md </>
- Add book badge to README.md </>
- Add getting help section to README.md </>
- Improve README with use cases, additional resources, and clearer structure </>
- Add support section to README.md </>
- Add Distributed Actor Communication section to README.md </>
- Improve code docs for remote module </>
- Add in-depth distributed actors information to kameo book (#51)
- Update heading levels in book </>
- Improve code docs and examples with all tests passing (#54)
- Add FAQ to book (#59)
Misc
- Add links to README badges (#47)
- Add gtag to kameo book (#52)
- Add Github CI </>
- Remote beta and nightly toolchains from CI </>
- Create CODE_OF_CONDUCT.md </>
- Add CONTRIBUTING.md </>
- Add github issue templates </>
- Move banner.png into docs directory </>
- Add .envrc to .gitignore </>
- Add pr detection to git cliff contributors </>
See the full CHANGELOG.md
v0.11.0
Added
- BREAKING: Add lifetime to requests to avoid mailbox cloning </>
- Use interned peer ids for improved performance (#43)
- Return stream from join handle in
attach_stream
</>
Changed
Fixed
attach_stream
panicking when actor is stopped </>
Documentation
- Add book explaining core concepts (#40)
- Add missing examples from actors page </>
- Fix indentation for request features </>
- Add note about Result::Err in the reply trait </>
- Add note about
SendError::HandlerError
in replies </> - Add icons and links to core concepts overview page </>
- Fix formatting in book </>
- Add icons to introduction headings </>
Misc
- Fix path to README in Cargo.toml </>
- Add obsidian related items to .gitignore </>
- Remove unused mailbox modules </>
- Update git cliff configuration </>
See the full CHANGELOG.md
v0.10.0
Added
- BREAKING: Add request traits (#39)
- Add delayed_send for unbounded actors </>
- Add remote actor support (#35)
- Add
actor
attribute toActor
derive macro </> - Make actor swarm listen address optional </>
- Use macro to clean request trait impls for
MaybeRequestTimeout
</>
Removed
- BREAKING: Remove queries (#36)
Fixed
- Call on_panic when actor panics during startup </>
Documentation
- Update README.md </>
- Improve documentation for async messages </>
- Add missing
mut
fromreply_sender
example </> - Add
MessageSend
import in code examples </>
Misc
- Fix path to README in Cargo.toml files </>
- Move kameo crate to root directory </>
- Add banner image </>
- Create dependabot.yml </>
- Remote PR number suffix from changelog generation </>
See the full CHANGELOG.md