While valid, I can't find a good use for XADDing while keeping the Stream at absolute zero.
Perhaps, if someone really wanted to, a zero-length Stream could be a substitute for Pub/Sub, i.e. no persistence. However, currently, blocking consumers are unblocked in this scenario, but do not get the message as it was already deleted.
Pseudo sample:
Terminal 1:
127.0.0.1:6379> XREAD BLOCK 0 STREAMS mystream $
1) 1) "mystream"
2) (empty list or set)
(4.11s)
Terminal 2:
127.0.0.1:6379> XADD mystream MAXLEN 0 * foo bar
"1546327021530-0"
Comment From: antirez
It can be considered one way (other than the others available) to create a zero length stream. If the user is willing to specify such odd parameter, I think it's ok for the server to comply... It may be also useful for testing certain things. In general given that you can reach an empty stream condition, the fact XADD can create it looks natural to me.
Comment From: itamarhaber
I'm cool with having empty streams (or at least I'm trying to make myself grow accustomed to the notion of an empty aggregate data structure - oh, btw https://github.com/antirez/redis-doc/pull/1067).
I just wanted to report the expected, but not very useful, behavior of an empty stream with blocking consumers. I'll keep it open just because it was labeled :)