Skip to content

Best Practices

Jeremy Green edited this page Sep 2, 2021 · 3 revisions

Job parameters should be simple objects

Before pushing your job to SQS Funktor will convert the job arguments to JSON.

This means that your job arguments should be simple data types (numbers, strings, boolean, array, hash) and not complex Ruby objects. Complex objects like Date or ActiveRecord models will not work properly.

So you should NOT do this:

# Don't do this
order = Order.find(order_id)
OrderProcessorWorker.perform_async(order)

Instead you should do this:

OrderProcessorWorker.perform_async(order_id)

Idempotency

TODO - Write this section...

Thinking about your app differently

TODO - Write this section...