Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix sample code in readme #245

Merged
merged 1 commit into from
Jun 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ never be executed in parallel. Following the actor model leads to microservices
An example `ping-pong` actor might be the following

```rust
use ractor::{cast, Actor, ActorProcessingErr, ActorRef};
use ractor::{async_trait, cast, Actor, ActorProcessingErr, ActorRef};

/// [PingPong] is a basic actor that will print
/// ping..pong.. repeatedly until some exit
Expand Down Expand Up @@ -113,6 +113,7 @@ impl Message {
}
}

#[async_trait]
// the implementation of our actor's "logic"
impl Actor for PingPong {
// An actor has a message type
Expand Down Expand Up @@ -172,7 +173,7 @@ which will output
```bash
$ cargo run
ping..pong..ping..pong..ping..pong..ping..pong..ping..pong..
$
$
```

## Messaging actors
Expand Down
Loading