See earlier comment about making this `void write(String val)`, rather than async.