TaskQueue shutdown handling
I currently use TaskQueue for management and component dispatch, so I have queues that run for the lifetime of the service. In this use case, the consequence of shutdown and risk of dangling resources afterward are inconsequential. But if it is used for something that is dynamic during the life of a service, there may be problems.
For example, if the queue has been stopped, all further dispatch requests should be ignored to prevent the channel from being swamped and blocking other tasks. Perhaps the simplest solution is to have the reader thread defer a channel close at exit, and to have the Dispatch method defer a recover() before sending. Even simpler may be to close the main channel at Shutdown and not have a separate stop channel at all, since recover() will keep dispatch from panicing if sending to a closed channel.