-
Notifications
You must be signed in to change notification settings - Fork 21
Closed
Labels
enhancementNew feature or requestNew feature or request
Milestone
Description
Currently the first argument of QueueManager::push accepts a callable which is passed to Enqueue\Client\Message. Since all cake jobs should implement Cake\Queue\Job\JobInterface our $callable value will always be an array where the second value is 'execute'. To make using the queue as easy as possible for all users it would be nicer to accept a string as the first argument of the push method which would be a fully qualified class name. This will make the code read easier and will be simpler to use.
Example of current usage:
QueueManager::push([HelloJob::class, 'execute'], ['name' => 'Alex']);Proposed usage:
QueueManager::push(HelloJob::class, ['name' => 'Alex']);If we accepted the FQCN as the first argument we could then construct the callable array for the user when we create the Enqueue\Client\Message. Something like:
$message = new ClientMessage([
'queue' => $queue,
'class' => [$firstArgClassNameVariable, 'execute'],
'args' => [$args],
]);Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request