Allow registering multiple ClassLoaders for a thread

This commit is contained in:
Dylan K. Taylor
2021-07-15 19:00:40 +01:00
parent ac8b13ee36
commit 5fbc7681b0
4 changed files with 43 additions and 23 deletions

View File

@ -147,7 +147,7 @@ class AsyncPool{
$this->eventLoop->addNotifier($notifier, function() use ($worker) : void{
$this->collectTasksFromWorker($worker);
});
$this->workers[$worker]->setClassLoader($this->classLoader);
$this->workers[$worker]->setClassLoaders([$this->classLoader]);
$this->workers[$worker]->start(self::WORKER_START_OPTIONS);
$this->taskQueues[$worker] = new \SplQueue();