Skip to content

Sock files are piling up in tmp folder. They are not getting cleared up automatically. #183

@MindGamer7

Description

@MindGamer7

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions