The job uses the data you pass to it. Just like any other class but the only difference is that the Job class can be queued and ran in background.
What data does a job use?
So when you render a job like so:
$job = (new CheckStatusOfFax($this->order))->delay(120);
$this->dispatch($job);
When it comes time to actually process the Job Class, is it doing a new query to get $this->order? In other words if that object changes over the 120 seconds, will it be used? The jobs table only seems to hold references to model IDs and not actual data so I assume when it comes time to actually process a job, it needs to get the data from somewhere. Or is this data cached somewhere? I am wondering because I have some process that require multiple jobs to be dispatched using the same resource.
Any help here would be appreciated.
Wait I just found the answer in the docs (https://laravel.com/docs/5.3/queues):
"If your queued job accepts an Eloquent model in its constructor, only the identifier for the model will be serialized onto the queue. When the job is actually handled, the queue system will automatically re-retrieve the full model instance from the database. "
Please or to participate in this conversation.