.NETに関するtyheのブックマーク (3)

  • neue cc - async/awaitのキャンセル処理やタイムアウトを効率的に扱うためのパターン&プラクティス

    async/awaitの鬼門の一つとして、適切なキャンセル処理が挙げられます。別に基的にはそんな難しいことではなく、CancellationTokenSourceを作る、CanellationTokenを渡す、OperationCanceledExceptionをハンドリングする。というだけの話です。けれど、Tokenに手動でコールバックをRegisterしたときとか、渡す口が空いてないものに無理やりなんとかするときとか、タイムアウトに使った場合の始末とか、ちょっと気の利いた処理をしたいような場面もあり、そうした時にどうすれば良いのか悩むこともあります。 こういうのはパターンと対応さえ覚えてしまえばいい話でもあるので、今回はAlterNatsの実装時に直面したパターンから、「外部キャンセル・タイムアウト・大元のDispose」が複合された状況での処理の記述方法と、適切な例外処理、そして最

    tyhe
    tyhe 2022/07/13
    CancellationToken むずかしいのじゃ……
  • Shows

    AI is suddenly everywhere. Do you need to go and get a shiny machine learning degree to remain competitive? John Maeda says not to worry. He’ll show you how to cook delicious dishes into your coding repertoire with his new show - Mr. Maeda’s Cozy AI Kitchen. Find out how you can use GitHub Copilot, an add-on that is powered by AI, to get helpful suggestions when writing code or documentation. This

    Shows
    tyhe
    tyhe 2015/01/19
  • .NET Foundation

    Search When autocomplete results are available use up and down arrows to review and enter to select. The following navigation has top level toggles that can be engaged with by focusing on them and pressing the enter key. Their respective sub-navigation can then be navigated through with the tab key. Upon reaching the last node in the sub-navigation the next top level node will be focused if there

  • 1