Getting our application running with Redis
Running our application with Redis locally will require us to use Redis with Docker, export the APP_TYPE
environment variable as "worker"
, and then run our application with Cargo. For our Redis, our docker-compose.yml
file takes the following form:
version: "3.7" services: redis: container_name: 'queue-redis' image: 'redis' ports: - '6379:6379'
We can then export our APP_TYPE
environment variable with the following command:
export APP_TYPE=worker
We can then run our application with the following command:
cargo run
When we run our application, we will get the following printout:
IncomingBody { one: "one", two: 2 } IncomingBody { one: "one", two: 2 } IncomingBody { one...