How to place site in Maintenance Mode using a worker

I have read some threads on how to create a worker to return an html page for a “Site down for maintenance page”, but from looking over the docs of workers I am missing how you actually place the site into the mode that would return the page from the worker. Is there an option to enable/disable the worker as needed if I want to manually place the site into a maintenance mode or does the worker need to respond to specific error codes. Any additional details on how to make this work would be great. Thanks.