You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using simple code similar to as follow as shown in AMPHP parallel example. However, sock files in tmp folder keep piling up
`$executions = [];
foreach ($urls as $url) {
// FetchTask is just an example, you'll have to implement
// the Task interface for your task.
$executions[$url] = Worker\submit(new FetchTask($url));
}
// Each submission returns an Execution instance to allow two-way
// communication with a task. Here we're only interested in the
// task result, so we use the Future from Execution::getFuture()
$responses = Future\await(array_map(
fn (Worker\Execution $e) => $e->getFuture(),
$executions,
));
class FetchTask implements Task
{
public function __construct(
private readonly string $url,
) {
}
public function run(Channel $channel, Cancellation $cancellation): string
{
return file_get_contents($this->url); // Example blocking function
}
}
`
The code runs fine but sock files are not cleared in system tmp folder. Please any suggestion what need to be done?
The text was updated successfully, but these errors were encountered:
Thanks for pointing out this issue! The temporary file was removed if the IPC socket was explicitly closed, but was not removed if the IPC socket was closed through destruction.
I am using simple code similar to as follow as shown in AMPHP parallel example. However, sock files in tmp folder keep piling up
`$executions = [];
foreach ($urls as $url) {
// FetchTask is just an example, you'll have to implement
// the Task interface for your task.
$executions[$url] = Worker\submit(new FetchTask($url));
}
// Each submission returns an Execution instance to allow two-way
// communication with a task. Here we're only interested in the
// task result, so we use the Future from Execution::getFuture()
$responses = Future\await(array_map(
fn (Worker\Execution $e) => $e->getFuture(),
$executions,
));
class FetchTask implements Task
{
public function __construct(
private readonly string $url,
) {
}
}
`
The code runs fine but sock files are not cleared in system tmp folder. Please any suggestion what need to be done?
The text was updated successfully, but these errors were encountered: