Initialize worker

Hi, is there an idiomatic way to initialize worker outside of the
fetch()
? I want to try the new connect() to connect to the database, but I don't want to do that repeatedly for every request that
fetch()
may handle. Is there something better than global variable and a mutex?
Was this page helpful?