Skip to content

Instantly share code, notes, and snippets.

@Uli-Armbruster
Created December 9, 2019 10:15
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 Uli-Armbruster/7429e9dc665a87a0ae9100d3e3b42d68 to your computer and use it in GitHub Desktop.
Save Uli-Armbruster/7429e9dc665a87a0ae9100d3e3b42d68 to your computer and use it in GitHub Desktop.
ProcessStepTimeout.cs
var totalTimeout = Observable
.Throw<TimeoutException>(new TimeoutException("my own text"))
.DelaySubscription(TimeSpan.FromSeconds(10));
var processStepTimeout = Observable
.FromEventPattern(btn_nextStep, nameof(btn_nextStep.Click))
.Timeout(TimeSpan.FromSeconds(3));
var sub = totalTimeout.Amb(processStepTimeout).Subscribe(ex => {}, ex => MessageBox.Show(ex.Message));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment