Skip to content

💻 Scalable application for simulating sending emails with Docker workers 🐳 and Pyhton with the Bottle micro-framework 🐍

Notifications You must be signed in to change notification settings

PedroLucasOM/EmailSenderWorker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Welcome to EmailSenderWorker 👋

Version documentation maintenance Twitter: PedroLucasOM

💻 Scalable application for simulating sending emails with Docker workers 🐳 and Pyhton with the Bottle micro-framework 🐍

Prerequisites

  • docker

Architecture

Observe the architectural model used in the application below:

Usage

With the docker started, perform the following steps:

Single worker

To run the application with a single worker, run the following command:

docker-compose up -d

Initially, when using the command above, the application will start with just 1 email message processor (worker), queuing requests and working synchronously, that is, only one message request is processed at a time.

See the following example:

Multiple worker

To run the application with multiple workers, run the following command:

docker-compose up -d --scale worker=3

That way, when using the command above, the application will start with 3 email message processors (workers), allocating messages among the available workers and queuing in each worker when everyone is busy. Thus, the application will work asynchronously between 3 workers.

See the following example:

Interface for sending requests

To send the messages, after starting the application, access http://localhost:80

You will see this screen:

Comparing

Single worker

In the first situation, each message sent needs to wait for the previous message to be processed, since there is only one worker.

Watch:

Message 1 was processed initially. Message 2 had to wait for message 1 to finish processing. Message 3 had to wait for message 2 to finish processing.

Multiple worker

In the second situation, each message sent checked which worker was available to process it, thus occupying the 3 available workers and making the processing of the 3 messages independent.

Watch:

Message 1 was initially processed at worker 1. Message 2 was processed on worker 3 (fetched one of the other available workers) Message 3 was processed on worker 2 (fetched the last available worker)

If a 4th message were sent to be processed, it would be queued in one of the workers, since everyone is busy.

Author

👤 Pedro Lucas

🤝 Contributing

Contributions, issues and feature requests are welcome!
Feel free to check issues page.

Show your support

Give a ⭐️ if this project helped you!

📝 License

Copyright © 2020 Pedro Lucas.

About

💻 Scalable application for simulating sending emails with Docker workers 🐳 and Pyhton with the Bottle micro-framework 🐍

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published