> So why is write not doing an implicit drain? Well it's a massive API oversight and I'm not exactly sure how it happened.
Separating these two operations allows code to use multiple write() calls to build up a single record atomically before yielding control to the system, where some other task might also write to the same stream. This reasoning is only valid if the program is running on a single thread, but that’s a reasonable architecture decision for many programs.