Yeah, I know, I know. But let me compare it to a restaurant anyway.
The cast
First, a mapping table. I'll stick with this analogy for the whole post.
Rails term In restaurant terms
Web request An order from a customer who walked in
Controller Cashier
Job Order ticket
perform_later Pinning the order ticket to the board
Queue The board where order tickets are pinned
Worker Cook
Adapter The type of board
Why do things "later" at all?
Say we have a feature that sends a welcome email when a user signs up.
class UsersController < ApplicationController def create user = User . create! ( user_params ) WelcomeMailer . with ( user : user ) . welcome . deliver_now # β you get stuck waiting a few seconds here render json : user end end
Enter fullscreen mode
Exit fullscreen mode
This is like the cashier taking an order, walking into the kitchen to cook it themselves, and not coming back to the register until it's done .β¦