pdxruby / bot

A friend that sends out meeting announcemnets
MIT License
0 stars 1 forks source link

plugins? #1

Open tloudon opened 6 years ago

tloudon commented 6 years ago

Hey @aarontc ,

I think we should look at some kind of a plugin architecture here. I would like to have something for Twitter, something for email, something for maybe Slack, etc. If we just have a crontab run a simple ruby scripts; all of the logic for each announcement could be encapsulated in that plugin. So the crontab wouldn't need to keep track of what plugins are running when and the calling client code wouldn't have to know much about each plugin either.

Does something like that make sense to you? We could also just make several independent scripts that run and have some awareness of what's running in the crontab or main ruby script.

I don't want to think about this too much, but some kind of a plugin architecture was the first thing that came to mind.

Thanks!

//cc @danascheider

aarontc commented 6 years ago

@tloudon A few minutes of Googling suggests PerfectSched (https://github.com/treasure-data/perfectsched) may be a very suitable gem to drive the schedule. Plugin support is baked in, with the ability to specify task types, routes from types to class names, and data to initialize the worker class with.