Skip to content
Merged
Show file tree
Hide file tree
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
48 changes: 38 additions & 10 deletions examples/README.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,56 @@
# Dapr Rust SDK - Examples

These examples demonstrates how to use Dapr rust sdk.
These examples demonstrate how to use the Dapr Rust SDK.

* [actors](src/actors)
* Demonstrates Dapr actor hosting and actor client calls
* [app-api-token](src/app-api-token)
* Demonstrates inbound auth on an app-callback server with `AppApiTokenLayer`
* [bindings](src/bindings)
* Demonstrates Dapr input and output bindings
* [client](src/client)
* Simple dapr client example that saves, gets, and deletes state from the state stores
* Saves, gets, and deletes state with a Dapr client
* [client-config](src/client-config)
* Demonstrates client construction from environment variables, options, and explicit addresses
* [configuration](src/configuration)
* Reads and subscribes to Dapr configuration values
* [conversation-alpha1](src/conversation-alpha1)
* Sends a request to the Dapr conversation alpha1 echo component
* [conversation-alpha2](src/conversation-alpha2)
* Sends a request to the Dapr conversation alpha2 echo component
* [crypto](src/crypto)
* Demonstrates Dapr cryptography operations
* [invoke/grpc](src/invoke/grpc)
* Demonstrates service invocation over gRPC
* [invoke/grpc-proxying](src/invoke/grpc-proxying)
* Demonstrates service invocation through Dapr gRPC proxying
* [jobs](src/jobs)
* Demonstrates Dapr job scheduling
* [jobs-failurepolicy](src/jobs-failurepolicy)
* Demonstrates Dapr job scheduling with a failure policy
* [pubsub](src/pubsub)
* Publishes and subscribes to events
* [query_state](src/query_state)
* Demonstrates state queries against a query-capable state store
* [secrets-bulk](src/secrets-bulk)
* Retrieves secrets in bulk from a local secret store
* [workflow](src/workflow)
* Demonstrates registering, running, waiting for, and purging a workflow
* [workflow-history-propagation](src/workflow-history-propagation)
* Demonstrates propagating workflow history to child workflows and activities
* [workflow-parallel](src/workflow-parallel)
* Demonstrates parallel workflow activity execution
* [workflow-taskexecutionid](src/workflow-taskexecutionid)
* Demonstrates activity retry task execution IDs
* [workflow-sustained](src/workflow-sustained)
* Demonstrates sustained concurrent workflow scheduling
* [workflow-history-propagation](src/workflow-history-propagation)
* Demonstrates propagating workflow history to child workflows and activities
* [workflow-taskexecutionid](src/workflow-taskexecutionid)
* Demonstrates activity retry task execution IDs

## Adding new examples

To add new examples, `Cargo.toml` would have to be updated as follows:
To add new examples, update `examples/Cargo.toml` with an entry like:

```rust
```toml
[[example]]
name = "example-name"
path = "examples/example-name/example.rs"
```
path = "src/example-name/main.rs"
```
4 changes: 2 additions & 2 deletions examples/src/actors/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,11 @@ dapr run -f .

1. Start actor host (expose Http server receiver on port 50051):
```bash
dapr run --app-id actor-host --app-protocol http --app-port 50051 cargo run -- --example actors-server
dapr run --app-id actor-host --app-protocol http --app-port 50051 -- cargo run --example actors-server
```

2. Start actor client:
```bash
dapr run --app-id actor-client --dapr-grpc-port 3502 cargo run -- --example actors-client
dapr run --app-id actor-client --dapr-grpc-port 3502 -- cargo run --example actors-client

```
2 changes: 1 addition & 1 deletion examples/src/client-config/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ timeout_seconds: 30
-->

```bash
dapr run --app-id=rustapp --dapr-grpc-port 50001 cargo run -- --example client-config
dapr run --app-id=rustapp --dapr-grpc-port 50001 -- cargo run --example client-config
```

<!-- END_STEP -->
2 changes: 1 addition & 1 deletion examples/src/client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ timeout_seconds: 30
-->

```bash
dapr run --app-id=rustapp --dapr-grpc-port 3500 --resources-path ./resources cargo run -- --example client
dapr run --app-id=rustapp --dapr-grpc-port 3500 --resources-path ./resources -- cargo run --example client
```

<!-- END_STEP -->
Expand Down
4 changes: 2 additions & 2 deletions examples/src/pubsub/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,10 @@ dapr run -f .

1. Run the subscriber with dapr
```bash
dapr run --app-id rust-subscriber --app-protocol grpc --app-port 50051 cargo run -- --example pubsub-subscriber
dapr run --app-id rust-subscriber --app-protocol grpc --app-port 50051 -- cargo run --example pubsub-subscriber
```

2. Run the publisher with dapr
```bash
dapr run --app-id rust-publisher --app-protocol grpc cargo run -- --example pubsub-publisher
dapr run --app-id rust-publisher --app-protocol grpc -- cargo run --example pubsub-publisher
```
4 changes: 2 additions & 2 deletions examples/src/query_state/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ sleep: 15
timeout_seconds: 30
-->
```bash
dapr run --app-id=rustapp --dapr-grpc-port 3501 --resources-path statestore/ cargo run -- --example query-state-1
dapr run --app-id=rustapp --dapr-grpc-port 3501 --resources-path statestore/ -- cargo run --example query-state-1
```
<!-- END_STEP -->

Expand Down Expand Up @@ -126,7 +126,7 @@ sleep: 15
timeout_seconds: 30
-->
```bash
dapr run --app-id=rustapp --dapr-grpc-port 3501 --resources-path statestore/ cargo run -- --example query-state-2
dapr run --app-id=rustapp --dapr-grpc-port 3501 --resources-path statestore/ -- cargo run --example query-state-2
```
<!-- END_STEP -->

Expand Down
2 changes: 1 addition & 1 deletion examples/src/secrets-bulk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ timeout_seconds: 30
-->

```bash
dapr run --app-id=rustapp --dapr-grpc-port 3500 --resources-path ./resources/ cargo run -- --example secrets-bulk
dapr run --app-id=rustapp --dapr-grpc-port 3500 --resources-path ./resources/ -- cargo run --example secrets-bulk
```

<!-- END_STEP -->
Expand Down
Loading