Nice work! Something like this which matches up requests and responses (e.g., with an incrementing integer) is absolutely required for using web workers for repeated tasks. Everybody has to solve this problem. I wish it were built in.
One suggestion: add a priority queue in the main thread to allow high priority requests to be processed before low priority.
2 comments
[ 4.8 ms ] story [ 13.8 ms ] threadOne suggestion: add a priority queue in the main thread to allow high priority requests to be processed before low priority.