I've created my first job using the rails generator:
rails g job do_something
which created the job file:
class DoSomethingJob < ApplicationJob
queue_as :default
def perform(*args)
# Do something later
end
end
The splat operator is new to me (I understand that it can be used to pass multiple arguments and it will group them into an array).
My question is, why do jobs come with the splat operator by default - def perform(*args)
? My temptation is to simply delete the default *args
but I'm worried I might be missing something.
Is there anything wrong with deleting the default *args
and creating arguments like I would for any other method? Or do I need to be using the splat operator with all jobs?
Any and all help appreciated!