Implements a mostly-working asynchronous sample writer.