Skip to content

Commit

Permalink
doc: more info on limitation of the request
Browse files Browse the repository at this point in the history
  • Loading branch information
xgroleau committed Sep 20, 2023
1 parent 4ca1f7c commit 1aa1a4f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ector/src/actor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,9 @@ where
pub type DynamicAddress<M> = DynamicSender<'static, M>;

/// Type alias over a [DynamicAddress] using a [Request] as message
///
/// Safety: You should not cancel a request, it will cause the requesting thread to panic,
/// and cause UB if the Actor is still alive after the panic (i.e. in a different thread)
pub type DynamicRequestAddress<M, R> = DynamicSender<'static, Request<M, R>>;

/// A handle to another actor for dispatching messages.
Expand All @@ -147,6 +150,9 @@ pub type DynamicRequestAddress<M, R> = DynamicSender<'static, Request<M, R>>;
pub type Address<M, MUT, const N: usize = 1> = Sender<'static, MUT, M, N>;

/// Type alias over a [Address] using a [Request] as message
///
/// Safety: You should not cancel a request, it will cause the requesting thread to panic,
/// and cause UB if the Actor is still alive after the panic (i.e. in a different thread)
pub type RequestAddress<M, R, MUT, const N: usize = 1> = Sender<'static, MUT, Request<M, R>, N>;

pub struct Request<M, R>
Expand Down

0 comments on commit 1aa1a4f

Please sign in to comment.