Git Product home page Git Product logo

csharp-async-test's Introduction

C# AsyncTest

C# で指定された時間周期で非同期処理を実行するサンプル

  • C# の Windows Form アプリ
    • Visual Studio 2015 で作成
  • 指定された周期で処理を実行したい
    • Timerを使えば、 Interval プロパティで指定した時間 (ms) ごとに処理ができます。
  • 処理は複数あり、それぞれの所要時間は瞬時〜数十秒
  • 各処理は並列で処理したい
    • 各処理を Task.Run メソッドで呼び出し、非同期実行しましょう。
  • 同じ処理は重複実行しないように制御
    • Task.Status で実行中かどうかの判定ができます。
  • 中断ボタンをクリックすると周期実行を中断し、実行中の処理をキャンセルする
    • CancellationTokenSource.Cancel メソッドで実行中の Task をキャンセルできます。

csharp-async-test's People

Contributors

kazunori-kimura avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.