In chapter 18, when defining the DispatchTimerSubscription
you use
self.requested -= .max(1)
self.timer -= .max(1)
and I wonder what .max(1)
actually does and why it’s needed.
I imaging it creates a new Demand
object, initialized by 1 and then subtracts that one from either requested
or timer
.
I wonder why one couldn’t simply write
self.requested -= 1
self.timer -= 1
1 post - 1 participant