File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -43,13 +43,13 @@ use Terremoth\Async\PhpFile;
43
43
use Terremoth\Async\Process;
44
44
45
45
$process = new Process();
46
- $process->send(function () {
46
+ $age = 30;
47
+ $name = 'John Doe';
48
+ $fruits = ['orange', 'apple', 'grape'];
49
+
50
+ $process->send(function () use ($age, $name, $fruits) {
47
51
/*
48
- // anything you want to process here
49
- // Important note: do not use closure vars, like:
50
- // $process->send(function () use ($var1, $var2, ...) { ... });
51
- // since the closure will be processed in another file.
52
- // Write everything you want without outside dependencies here
52
+ // Anything you want to process here, you can use closure vars
53
53
// In a future version I will create communications variables between both processes
54
54
*/
55
55
});
You can’t perform that action at this time.
0 commit comments