Add support for using within a worker thread