Datasink write functions ordering

Hello team,

I wanted to understand the ordering of on_write_start(), write() and on_write_complete() functions. Is the sequence of execution same as above or something else? Could you help me with an example having all 3 functions invoked?