/queue.cs Secret
Last active
May 2, 2023 18:14
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var cancellationToken = new CancellationTokenSource(TimeSpan.FromSeconds(30)).Token; | |
lock (_lock) | |
{ | |
if (cancellationToken.IsCancellationRequested) | |
throw new TimeoutException(); | |
// critical section - crawling | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment