snivilised / lorax

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

allocate sequence no and id for each job #274

Closed plastikfan closed 3 months ago

plastikfan commented 3 months ago

the return value of Invoke/Submit should be a meta data object that contains a sequence number and a unique identifier (using the id-generator). The generator needs to be synchronised.

Instead of introducing a new lock to ensure that the meta object is created ok, we should tap into the existing critcal section that has already been established. The call to retrieveWorker is internally protected by a lock, so perhaps we could tap into this, but bear in mind, that until the pool is at capacity, multiple GRs could still be able to access the shared resource concurrently, so be careful of this.

plastikfan commented 3 months ago

already completed