Closed PetrGlad closed 7 years ago
Another comment is that using 3 state variables stopping, stopped, and running begs for inconsistencies (e.g. running == true and stopped == true), I would implemented it a single state var and enum, say, [INIT, STARTED, STOPPING, STOPPED].
That's fair and a pull request is welcome.
lgtm :shipit:
I'll try to prepare the PR for started/stopped flags. If no one is working on this yet.
Not a bug, bus still looks suspicious of first sight.
This is more of a comment. I see that
StreamProcessor#stopping()
checks boththis.stopped
andthis.stopping
while in both cases when stopping is used bothStreamProcessor#stopping()
andStreamProcessor#stopped()
are invoked:!stopping() && !stopped() && started()
inStreamProcessor#running()
stopped() || stopping()
in inStreamProcessor#start()
So this looks redundant. That is
StreamProcessor#stopping()
could check onlythis.stopping
without logic change, or, alternatively, leave onlyStreamProcessor#stopped
that would check both.Another comment is that using 3 state variables
stopping
,stopped
, andrunning
begs for inconsistencies (e.g. running == true and stopped == true), I would implemented it a single state var and enum, say, [INIT, STARTED, STOPPING, STOPPED].