mborders / artifex

Simple in-memory job queue for Golang using worker-based dispatching
MIT License
203 stars 13 forks source link

Throttling #6

Open muety opened 1 year ago

muety commented 1 year ago

Awesome library, pretty much exactly what I was looking for! There is one feature I'd still like to have, though.

I'd like to have the ability to create throttled dispatchers, that is, dispatchers which run no more than X jobs per time (e.g. 5 per minute), regardless of which rate new jobs are created at.

This could be helpful when sending out large amounts of e-mails, for example. Say, I want to send an e-mail to each of 1,000 users every Friday night, but don't want to send them all at once, but over a period of 30 minutes, to relieve the mail server a bit.

mborders commented 1 year ago

Sorry for the delay, thanks for the feedback! That is an interesting concept, I'll see if I can get that added soon. I'll report back soon. Thanks!