Implement message writer.

Yeah I skipped it under the assumption that only the application would ever set this, never the worker thread.