Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

polling data source c# using threads

int delay = 1;
var cancellationTokenSource = new CancellationTokenSource();
var token = cancellationTokenSource.Token;
var listener = Task.Factory.StartNew(() =>
{
    while (true)
    {
        // poll source

        Thread.Sleep(delay);
        if (token.IsCancellationRequested)
            break;
    }

    // cleanup, e.g. close connection
}, token, TaskCreationOptions.LongRunning, TaskScheduler.Default);
Comment

PREVIOUS NEXT
Code Example
Csharp :: enemy turret one direction ahooting script unity 2d 
Csharp :: unity product.hasreceipt 
Csharp :: laravel get current url 
Html :: favicon meta 
Html :: html pound symbol 
Html :: how to use unsplash images in html 
Html :: html tab icon 
Html :: p5 cdn 
Html :: create a mailto link html 
Html :: bootstrap css cdn 
Html :: http://127.0.0.1:5500/favicon.ico 
Html :: href email in html 
Html :: disable html form input autocomplete autofill 
Html :: tab space in html 
Html :: how to change website icon html 
Html :: html head logo 
Html :: tailwind cdn 
Html :: bootstrap footer bottom of page 
Html :: html change viewport to smartphone size 
Html :: youtube video image 
Html :: font awesome 5 cdn 
Html :: fafa login icons html code 
Html :: how to open a website inside a website 
Html :: dropdown in html 
Html :: html link tag 
Html :: django jinja extract elements from form object 
Html :: html form action target blank 
Html :: alpine js onclick example 
Html :: html add image from url 
Html :: how to read an input from HTML in javascript 
ADD CONTENT
Topic
Content
Source link
Name
6+5 =