It doesn't actually use the same promise. It's just adding a listener to the promise to defer closing until the write is complete.