Yo!

@gsamokovarov

Morning!

rubybanitsa.com

@rubybanitsa

Will repeat at least until we run out of banitsa.

May change them dates and times.

May change locations.

May have presentations.

Scheduled Tasks

Tasks that happen on a schedule.

CRON++

  • Available anywhere
  • Crontab management

CRON--

  • Available anywhere
  • Crontab management

CRON--

How do you actually write those?

CRON--

Where do you put them?

CRON--

Error management?

Do you even scale, brah?

Scheduled tasks...

I dunno how to manage scheduled tasks...

But!

I sure know how to manage background tasks!

Active Job++

  • Know where to put them!
  • Know how to write them!
  • Know how to scale them!
  • Know how to error handle them!

Active Job--

  • How to dispatch them?

How to dispatch them?

CRON++

  • Available anywhere
  • Crontab management

CRON--

  • Spawning a Ruby process...
  • to queue a background job

Can we do better than this?

Clockwork++

  • Foreground Ruby process
  • Put an init script and forget managing it
  • No ruby spawning to queue a job
  • Easy to automate/test locally

Clockwork--

  • Dependency

Dependency

I know, just another line in the Gemfile.

What's the big deal?

Dependencies are like drugs!

THEY ARE AWESOME!

THEY ARE AWESOME!

This one is kinda unstable, maintenance-wise...

Clockwork--

  • High CPU usage with the default interval
  • Missing events with longer intervals
  • Missing events during redeploys
  • Loosely maintained

USE CRON!

IT'S FINE!

IT WILL MAKE YOU FEEL GOOD!

OR USE CLOCKWORK, WHATEVER