Skip to content

docs: Fix actor address retrieval example using send().await - #775

Merged
JohnTitor merged 1 commit into
actix:mainfrom
thefauxpastrouper:docs/fix-actor-address-example
Jul 6, 2026
Merged

docs: Fix actor address retrieval example using send().await#775
JohnTitor merged 1 commit into
actix:mainfrom
thefauxpastrouper:docs/fix-actor-address-example

Conversation

@thefauxpastrouper

Copy link
Copy Markdown
Contributor

This PR updates the documentation example for retrieving an actor's address via Context::address() to ensure the code functions as described and compiles correctly.

Changes made:

Replaced do_send with send().await: The previous example used addr.do_send(WhoAmI{}). Because do_send fires off a message blindly and ignores the response, who_addr would not actually capture the requested address. Updating this to addr.send(WhoAmI {}).await correctly awaits the Future and captures the returned actix::Addr.

Added Actor initialization: Included let addr = MyActor.start(); before the message is sent. In the previous snippet, addr was used without being defined, which could confuse readers trying to implement the example.

This PR updates the documentation example for retrieving an actor's address via Context::address() to ensure the code functions as described and compiles correctly.

Changes made:

Replaced do_send with send().await: The previous example used addr.do_send(WhoAmI{}). Because do_send fires off a message blindly and ignores the response, who_addr would not actually capture the requested address. Updating this to addr.send(WhoAmI {}).await correctly awaits the Future and captures the returned actix::Addr<MyActor>.

Added Actor initialization: Included let addr = MyActor.start(); before the message is sent. In the previous snippet, addr was used without being defined, which could confuse readers trying to implement the example.
@netlify

netlify Bot commented Jul 6, 2026

Copy link
Copy Markdown

Deploy Preview for actix-website ready!

Name Link
🔨 Latest commit 225501d
🔍 Latest deploy log https://app.netlify.com/projects/actix-website/deploys/6a4bcdf169100c00080d221a
😎 Deploy Preview https://deploy-preview-775--actix-website.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@JohnTitor JohnTitor left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@JohnTitor
JohnTitor added this pull request to the merge queue Jul 6, 2026
Merged via the queue into actix:main with commit 565f53a Jul 6, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants