File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed
Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+
3+ declare (strict_types=1 );
4+
5+ namespace Vectorial1024 \LaravelProcessAsync ;
6+
7+ use RuntimeException ;
8+
9+ /**
10+ * Represents the status of an async task: "running" or "stopped".
11+ *
12+ * This does not tell you whether it was a success/failure, since it depends on the user's custom result checking.
13+ */
14+ class AsyncTaskStatus
15+ {
16+ /**
17+ * Constructs a status object.
18+ * @param string $taskID The task ID of the async task so to check its status.
19+ */
20+ public function __construct (
21+ public readonly string $ taskID
22+ ) {
23+ if ($ taskID === "" ) {
24+ // why no blank IDs? because this will produce blank output via base64 encode.
25+ throw new RuntimeException ("AsyncTask IDs cannot be blank " );
26+ }
27+ }
28+ }
You can’t perform that action at this time.
0 commit comments