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
My request may sound strange, but bare with me, currently piscina is designed for worker threads is more functional stateless approach and this may work for 90% use cases, but my use case requires me to hold a instance of class on a thread and keep it long running. The reason for this is cause i hold iterator on the worker thread side and exchange bulk messages for iteration between it and main thread.. can this be done via piscina?
What i am doing is opening sqlite DBs queries on worker threads in iterator mode and doing a k-way merge on main thread.. and i dont want to keep reopening these queries.. any suggestions?
The text was updated successfully, but these errors were encountered:
Basically Piscina threads are meant to be destroyed if idle. This happens immediately by default, and can be extended accordingly.
Sadly, even passing Inifinity won’t work as we rely on a setTimeout that will take care of verifying if the worker is idle or not and destroy it if so.
One workaround is to have a single long-running that that abstains the worker from being idle, this will require to set you concurrentTaskPerWorker to N + 1 value.
I can see the benefit of having long-running threads, so happy to support a contribution to implement the feature.
My request may sound strange, but bare with me, currently piscina is designed for worker threads is more functional stateless approach and this may work for 90% use cases, but my use case requires me to hold a instance of class on a thread and keep it long running. The reason for this is cause i hold iterator on the worker thread side and exchange bulk messages for iteration between it and main thread.. can this be done via piscina?
What i am doing is opening sqlite DBs queries on worker threads in iterator mode and doing a k-way merge on main thread.. and i dont want to keep reopening these queries.. any suggestions?
The text was updated successfully, but these errors were encountered: