Skip to content

Instantly share code, notes, and snippets.

@mattpodwysocki
Created February 9, 2013 00:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattpodwysocki/8d9a17df9fb94a3fb631 to your computer and use it in GitHub Desktop.
Save mattpodwysocki/8d9a17df9fb94a3fb631 to your computer and use it in GitHub Desktop.
Like so?
signals.Publish(_signals => _signals.Where(s => isBusy(s)).Publish(_busy =>
from s in _busy
from n in _signals.Where(s => isNotBusy(s)).TakeUntil(endTime).Count().Where(n => n == 0).TakeUntil(_busy)
select TurnIndicatorOn)))))))
--------B----N---N---------B---N------N----N---B---------------------------- _signals
--------B------------------B-------------------B---------------------------- _busy
|----N----N---x |---N------N----N--x|----------x _signals.Where(s => isNotBusy(s)).TakeUntil(endTime).TakeUntil(_busy)
-------------2 ------------------3 ----------0 _signals.Where(s => isNotBusy(s)).TakeUntil(endTime).Count()
----------------------------------------------------------On---------------
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment