How do I run commands concurrently?

I have a project uses interprocess-communication using RabbitMQ.

I want to run rabbitmq in one shell and consumer and publisher in separate instances.

For example:

  1. rabbitmq-server

  2. While that rabbitmq-server is running, I want to run a python service _python3 receiver.py_ in another separate shell

  3. In another instance I want to be able to run another service _python3 sender.py_ and _python3 passive\_sender.py_

Sorry I’m new to creating pipelines and workflows.

3 Likes

It sounds like you might want to run the server in the background?  The & symbol at the end of a command in bash will run the command in the background.  For example, to run rabbitmq-server in the background, and the receiver _also_ in the background, and then run (blocking) on the sender:

  • run: |

    rabbitmq-server &

    python3 receiver.py &

    python3 sender.py

3 Likes

This doesn’t seems work on windows. The script won’t report error, but looks like not execute in the end. My case is using choco install nasm vscode &