Ruby Multi Threading With Pool Size

A continuation from my previous Sending Personalized SMS article. Lets imagine telco allows you to send as many messages as you can without limits and you have 100,000 messages to send to all your customers.

If you can only send 1 message per second, it will take almost 28 hours to complete. What if you run it multi threaded with a pool size of 10? That will shorten it down to almost 3 hours to complete the same task.

Say you have the name list of the 100,000 customers in “list.txt”.

+6598765432|Person1
.
.
.
.