Open akbashev opened 12 months ago
Thanks for reporting, will look soon
btw think I've pushed a error in SPM in example before 🙈 fixed that, now should work
Ok, after a bit of testing and checking repo around, think this PR and particular WeakWhenLocal
wrapper can fix this issue. Will double check.
Probably there should be a better way to fix :)
Actually looking back again into issue and thinking a bit more about, introduction of some type like WeakWhenLocal
makes sense.
Making worker reference either just weak or just strong will both give you a problem:
So you (or system) need to know if it's local or remote reference for WorkerPool. And this PR is actually should fix it. 🤔
Description WorkingPool unexpected behaviour when workers are on different node
Steps to reproduce https://github.com/akbashev/WorkerPoolTest
Two nodes:
If you run an example and submit some work—WorkingPool will terminate all workers in
selectWorker()
function, seems like actor is none here:Expected behavior Pool is routing job to workers, e.g. will log:
Environment MacOS 14.0 Beta (23A5286i), Xcode 15.0 Beta 4 (15A5195m), Swift 5.9