Spreading incoming events evenly in time, using Combine

How to spread incoming messages (A, B, ...) evenly, one every second, marking them with most recent timestamps (1, 2, ...) ?

  • output on the gray stripe, input above it:

It requires buffering messages (e.g. B) when necessary, and omitting timer ticks (e.g. 4) in case there were no messages to consume, current or buffered.

Spreading incoming events evenly in time, using Combine
 
 
Q