snivilised / lorax

🌟 reactive extensions for go (a pseudo rxgo version 3)
MIT License
4 stars 0 forks source link

add ants worker pool #268

Closed plastikfan closed 3 months ago

plastikfan commented 3 months ago

the worker pool in ants looks ok-ish to user but it has some deficiencies:

1) no function result; what happens if we wish to submit a job that needs a result, eg a calculation 2) no error returned

The source code will be copied into lorax and heavily modified, but its core will remain the same. I have no need for a multi pool, so this wil not be used.

This task will port the stretchr tests to use ginko (but actually as we already know the worker-pool works, do not implement all the tests straight away, just do a couple of key tests. Only once we have established that we can make our own changes to the core, will we implment all the tests; I don't want to repeat the mistake I made with rxgo, where I implememnted all the units tests ajust to find out at the end, that rxgo was unsuitable).

The idea behind the use of ants will be to retain most of the user interface we already defined in the legacy work pool but use the ants worker pool under the covers. One change we'll make will be to allow the job to specific an executive function that will override the one defined on the pool; this will allow many different types of execution to occur in the ppol, not just the default one defined on the pool.