Skip to content

Commit

Permalink
add queue helper
Browse files Browse the repository at this point in the history
  • Loading branch information
markhuot committed Jun 13, 2024
1 parent 509e54f commit e31cfb4
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"src/helpers/Craft.php",
"src/helpers/Http.php",
"src/helpers/Model.php",
"src/helpers/Queue.php",
"src/helpers/Test.php"
]
},
Expand Down
15 changes: 15 additions & 0 deletions src/helpers/Queue.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

namespace markhuot\craftpest\helpers\queue;

use Craft;

if (! function_exists('queue')) {
function queue($callback) {
$result = $callback();

Craft::$app->queue->run();

return $result;
}
}

0 comments on commit e31cfb4

Please sign in to comment.