generated from Sammyjo20/package-template
-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from Sammyjo20/feature/dispatch-all-helper
Feature | Dispatch all helper
- Loading branch information
Showing
4 changed files
with
93 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php declare(strict_types=1); | ||
|
||
namespace Sammyjo20\ChunkableJobs\Tests\Fixtures; | ||
|
||
use Illuminate\Bus\Queueable; | ||
use Sammyjo20\ChunkableJobs\Chunk; | ||
use Illuminate\Queue\SerializesModels; | ||
use Illuminate\Queue\InteractsWithQueue; | ||
use Sammyjo20\ChunkableJobs\ChunkableJob; | ||
use Illuminate\Contracts\Queue\ShouldQueue; | ||
use Illuminate\Foundation\Bus\Dispatchable; | ||
|
||
class ConstructorArgsJob extends ChunkableJob implements ShouldQueue | ||
{ | ||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels; | ||
|
||
/** | ||
* @param string $name | ||
*/ | ||
public function __construct(public string $name) | ||
{ | ||
// | ||
} | ||
|
||
public function defineChunk(): ?Chunk | ||
{ | ||
return new Chunk(30, 10); | ||
} | ||
|
||
protected function handleChunk(Chunk $chunk): void | ||
{ | ||
cache()->put($chunk->position, $this->name); | ||
} | ||
} |