Currently it's assumed that you'd use 1 task pool per pair of ports.
However, this is not the case with something like a nested TEA
single page app, where it makes sense to have a task pool per page. It's unsafe currently to do this:
- A task is in-flight from one pool (say internally it has an attempt id of
0
).
- The user switches pages and immediately starts a task.
- The attempt ids would overlap and there would likely be a weird race condition.
A possible solution would be to add ConcurrentTask.namedPool
where you could give a pool a unique name / id - this would prevent race conditions as the runner would know which task pool the responses are associated with.
There may be a way for the pool to initially generate a random id internally before it does any work, but would have to experiment with that and hopefully not break the types