Skip to content

Commit 0548ca3

Browse files
committed
Remove sockets on main shutdown
1 parent 1db5357 commit 0548ca3

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

EProcess/Adapter/PThreads.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ public function create($class, array $data = [])
2020
$node = uniqid('thread_');
2121
$unix = sprintf('unix://tmp/%s.sock', $node);
2222

23+
register_shutdown_function(function() use ($unix) {
24+
unlink($unix);
25+
});
26+
2327
$messenger = MessengerFactory::server($unix, $this->loop);
2428

2529
$this->process = new Thread($unix, $class, $data);

EProcess/Adapter/SymfonyProcess.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ public function create($class, array $data = [])
5858
$node = uniqid('thread_');
5959
$unix = sprintf('unix://app/cache/%s.sock', $node);
6060

61+
register_shutdown_function(function() use ($unix) {
62+
unlink($unix);
63+
});
64+
6165
$messenger = MessengerFactory::server($unix, $this->loop);
6266

6367
$script = sprintf($this->script, EPROCESS_AUTOLOAD, $unix, $class, base64_encode($this->serialize($data)));

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy