dispatch(function () { ... }) is convenient and works by serialising the closure with a signature, which has consequences worth knowing before it is used anywhere important.
dispatch(function () use ($order) {
$order->markExported();
});
// what this actually does:
// serialises the closure's code and its captured scope
// signs it with APP_KEY so it cannot be tampered with
// deserialises it in a worker that may be running older code
The signature is what stops a queue with write access becoming remote code execution, and it means rotating APP_KEY invalidates every pending closure job. The deeper problem is deployment: a worker running the previous release deserialises a closure whose code has changed, and the behaviour is whichever version the worker has. A named job class has a name that is stable across releases, which is why anything that must survive a deploy should be one.