Skip to content

Commit

Permalink
docs: fix typos (#128)
Browse files Browse the repository at this point in the history
  • Loading branch information
Plebshot authored Jan 29, 2025
1 parent d40e8a5 commit 0c30768
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Kameo is not just for distributed applications; it's equally powerful for local

### Installation

Add kameo as a dependency in your `Cargo.toml` file:
Add Kameo as a dependency in your `Cargo.toml` file:

```toml
[dependencies]
Expand Down
8 changes: 4 additions & 4 deletions src/actor/spawn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -343,15 +343,15 @@ where

let mut actor = state.shutdown().await;

let mut link_notificication_futures = FuturesUnordered::new();
let mut link_notification_futures = FuturesUnordered::new();
{
let mut links = links.lock().await;
#[allow(unused_variables)]
for (link_actor_id, link) in links.drain() {
match link {
Link::Local(mailbox) => {
let reason = reason.clone();
link_notificication_futures.push(
link_notification_futures.push(
async move {
if let Err(err) = mailbox.signal_link_died(id, reason).await {
#[cfg(feature = "tracing")]
Expand All @@ -365,7 +365,7 @@ where
Link::Remote(notified_actor_remote_id) => {
if let Some(swarm) = remote::ActorSwarm::get() {
let reason = reason.clone();
link_notificication_futures.push(
link_notification_futures.push(
async move {
let res = swarm
.signal_link_died(
Expand All @@ -391,7 +391,7 @@ where
let on_stop_res = actor.on_stop(actor_ref, reason.clone()).await;
log_actor_stop_reason(id, name, &reason);

while let Some(()) = link_notificication_futures.next().await {}
while let Some(()) = link_notification_futures.next().await {}
#[cfg(feature = "remote")]
remote::REMOTE_REGISTRY.lock().await.remove(&id);

Expand Down
8 changes: 4 additions & 4 deletions src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,7 @@ impl PanicError {
PanicError(Arc::new(Mutex::new(err)))
}

/// Calls the passed closure `f` with an option containing the boxed any type downcasted into a `Cow<'static, str>`,
/// Calls the passed closure `f` with an option containing the boxed any type downcast into a `Cow<'static, str>`,
/// or `None` if it's not a string type.
pub fn with_str<F, R>(
&self,
Expand All @@ -611,7 +611,7 @@ impl PanicError {
})
}

/// Calls the passed closure `f` with the inner type downcasted into `T`, otherwise returns `None`.
/// Calls the passed closure `f` with the inner type downcast into `T`, otherwise returns `None`.
pub fn with_downcast_ref<T, F, R>(
&self,
f: F,
Expand Down Expand Up @@ -646,13 +646,13 @@ impl fmt::Display for PanicError {
return write!(f, "panicked: {s}");
}

// Types are `BoxError` if the panic occured because of an actor hook returning an error
// Types are `BoxError` if the panic occurred because of an actor hook returning an error
let box_err = any.downcast_ref::<BoxError>();
if let Some(err) = box_err {
return write!(f, "panicked: {err}");
}

// Types are `BoxDebug` if the panic occured as a result of a `tell` message returning an error
// Types are `BoxDebug` if the panic occurred as a result of a `tell` message returning an error
let box_err = any.downcast_ref::<BoxDebug>();
if let Some(err) = box_err {
return write!(f, "panicked: {:?}", Err::<(), _>(err));
Expand Down
2 changes: 1 addition & 1 deletion src/mailbox.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ pub trait MailboxReceiver<A: Actor>: Send + 'static {
fn recv(&mut self) -> impl Future<Output = Option<Signal<A>>> + Send + '_;
}

/// A weak mailbox which can be upraded.
/// A weak mailbox which can be upgraded.
pub trait WeakMailbox: SignalMailbox + Clone + Send + Sync {
/// Strong mailbox type.
type StrongMailbox;
Expand Down
2 changes: 1 addition & 1 deletion src/mailbox/bounded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use crate::{

use super::{Mailbox, MailboxReceiver, Signal, SignalMailbox, WeakMailbox};

/// An unbounded mailbox, where the sending messages to a full mailbox causes backpressure.
/// A bounded mailbox, where sending messages to a full mailbox causes backpressure.
pub struct BoundedMailbox<A: Actor>(pub(crate) mpsc::Sender<Signal<A>>);

impl<A: Actor> BoundedMailbox<A> {
Expand Down
6 changes: 3 additions & 3 deletions src/message.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! Messaging infrastructure for actor communication in kameo.
//! Messaging infrastructure for actor communication in Kameo.
//!
//! This module provides the constructs necessary for handling messages within kameo,
//! This module provides the constructs necessary for handling messages within Kameo,
//! defining how actors communicate and interact. It equips actors with the ability to receive and respond
//! to both commands that might change their internal state and requests for information which do not alter their state.
//!
Expand Down Expand Up @@ -101,7 +101,7 @@ where
/// is a marker type indicating that the message handler will delegate the task of replying to another part of the
/// system. It should be returned by the message handler to signify this intention. The `ReplySender`, if present,
/// should be used to actually send the response back to the caller. The `ReplySender` will not be present if the
/// message was sent as a "tell" request (no repsonse is needed by the caller).
/// message was sent as a "tell" request (no response is needed by the caller).
///
/// # Usage
///
Expand Down
14 changes: 7 additions & 7 deletions src/reply.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
//! Constructs for handling replies and errors in kameo's actor communication.
//! Constructs for handling replies and errors in Kameo's actor communication.
//!
//! This module provides the [`Reply`] trait and associated structures for managing message replies within the actor
//! system. It enables actors to communicate effectively, handling both successful outcomes and errors through a
//! unified interface.
//!
//! **Reply Trait Overview**
//!
//! The `Reply` trait plays a crucial role in kameo by defining how actors respond to messages.
//! The `Reply` trait plays a crucial role in Kameo by defining how actors respond to messages.
//! It is implemented for a variety of common types, facilitating easy adoption and use.
//! Special attention is given to the `Result` and [`DelegatedReply`] types:
//! - Implementations for `Result` allow errors returned by actor handlers to be communicated back as
Expand Down Expand Up @@ -49,20 +49,20 @@ use crate::{
message::{BoxDebug, BoxReply},
};

/// A boxed reply sender which will be downcasted to the correct type when receiving a reply.
/// A boxed reply sender which will be downcast to the correct type when receiving a reply.
///
/// This is reserved for advanced use cases, and misuse of this can result in panics.
pub type BoxReplySender = oneshot::Sender<Result<BoxReply, BoxSendError>>;

/// A deligated reply that has been forwarded to another actor.
/// A delegated reply that has been forwarded to another actor.
pub type ForwardedReply<T, M, E = ()> = DelegatedReply<Result<T, SendError<M, E>>>;

/// A reply value.
///
/// If an Err is returned by a handler, and is unhandled by the caller (ie, the message was sent asyncronously with `tell`),
/// If an Err is returned by a handler, and is unhandled by the caller (ie, the message was sent asynchronously with `tell`),
/// then the error is treated as a panic in the actor.
///
/// This is implemented for all many std lib types, and can be implemented on custom types manually or with the derive
/// This is implemented for all std lib types, and can be implemented on custom types manually or with the derive
/// macro.
///
/// # Example
Expand Down Expand Up @@ -138,7 +138,7 @@ where

/// A mechanism for sending replies back to the original requester in a message exchange.
///
/// `ReplySender` encapsulates the functionality to send a response back to whereever
/// `ReplySender` encapsulates the functionality to send a response back to wherever
/// a request was initiated. It is typically used in scenarios where the
/// processing of a request is delegated to another actor within the system.
/// Upon completion of the request handling, `ReplySender` is used to send the result back,
Expand Down
2 changes: 1 addition & 1 deletion src/request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ pub trait TryMessageSendSync {
/// Error value.
type Error;

/// Attemps to send a message synchronously without waiting for mailbox capacity.
/// Attempts to send a message synchronously without waiting for mailbox capacity.
fn try_send_sync(self) -> Result<Self::Ok, Self::Error>;
}

Expand Down

0 comments on commit 0c30768

Please sign in to comment.