Skip to content

program to send out emails to recipients from a huge list

Notifications You must be signed in to change notification settings

azin-z/coding-challenge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

coding-challenge

program to send out emails to recipients from a huge list

justification for the picked approach

A multithreaded approach is used to send the emails concurrently. Multithreading is sometimes not a good solution in python because of the Global Interpreter Lock in CPython. But this is only a problem when the task is CPU bound. It does not affect this example, because in each thread we're merely calling a sleep function which releases the GIL and lets other threads execute. Since the email sending code will also be an IO bound work, the concurrency of a multithreaded program greatly speeds things up. It won't let the CPU sit idle and runs other threads as one thread is waiting for the API call to finish.

Requirements

This code runs in Python 3.

How to run

from the code folder, run:

python main.py

Optionally you can provide a -w parameter that chooses how many worker threads to use. By default this number is set to 100.

python main.py -w 10

About

program to send out emails to recipients from a huge list

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages