oban-bg/oban

Scheduling strategy for upholding Slack postMessage limits

Closed this issue · 1 comments

Hey,

Thanks for the magnificent package. It blows other similar packages I know out of the water.

Currently, I'm working on a daily journal bot that sends a reminder to all subscribed users to answer two questions at the beginning of their day.

For that, I need to uphold Slack API postMessage limits:

  • 1 direct message per second
  • 600 direct messages per workspace

I'm not really worried about the second limit - that would be an excellent problem to have, but it's not going to crop in any time soon.

Another consideration is that people should be able to adjust the time when they want to receive their messages which adds a bit of complexity.

Here is the picture I have so far

  • I'm considering separately storing the preferred message delivery time (or using the default 9 am).
  • Based on those settings I should schedule jobs for sending messages
  • All messages for a specific organisation should go through a designated queue so that I can uphold the 1 DM per second limit.

Those are general thoughts not grounded in the expert Oban knowledge required to solve the puzzle and I'd love to hear your opinion on how I can use Oban to meet those requirements (I reckon that I may require Oban Pro).

Best,
Yevhenii

I figured out Elixir forum might be a better medium for this type of question https://elixirforum.com/t/upholding-slack-postmessage-limits-with-oban/57298