home.social

#asyncawait — Public Fediverse posts

Live and recent posts from across the Fediverse tagged #asyncawait, aggregated by home.social.

fetched live
  1. 🚨 Warning: Incoming Nerd Alert 🚨 - Welcome to an existential crisis where async/await, the beloved darling of the dev world, gets ruthlessly roasted for being a lazy, good-for-nothing imposter. 🤯 Who knew making something "easy" came with so much "structural complexity"? 🤡
    pmbanugo.me/blog/why-async-awa #NerdAlert #asyncAwait #DevWorld #StructuralComplexity #ExistentialCrisis #HackerNews #ngated

  2. Одна строчка .Result роняет ваш ASP.NET Core при CPU 8 %: разбор hill-climbing в .NET 9

    TL;DR. Один «безобидный» foo.GetAsync().Result в middleware способен превратить ASP.NET Core, державший 50k RPS с p99 = 40 мс, в сервис с 12k RPS и p99 = 4 с — при CPU 8 %. Виноват не сам blocking call, а hill-climbing — фидбэк-луп в ThreadPool, в недрах которого живёт дискретное преобразование Фурье. Разбираем по исходникам CoreCLR, почему это вообще возможно, воспроизводим эффект на ~80 строках кода и разбираемся, почему SetMinThreads — не решение, а анестезия.

    habr.com/ru/articles/1040804/

    #threadpool #hillclimbing #asyncawait #net9 #aspnetcore #starvation #configureawait #taskresult #bulkhead #setminthreads

  3. CW: a rant with expletives about JavaScript

    So the caller must await too. Ah no, rather return-immediately-with-a-fucking-promise. And so the caller's caller too and so on.

    Now you hardly have a function call not preceded by await. Ask yourself: why is that not the default? For the other case, lets invent the keyword **getlost** to get the functionality we now have if we forget await.

    😡 Sorry for venting. It is a relief.

    #javascript #typescript #async #await #asyncawait

  4. CW: a rant with expletives about JavaScript

    Because that's what it actually is. It does not wait at all. Quite contrary, it returns immediately, throwing the rest of the function code into a pool of stuff to be executed some day.

    And the caller? Getting control back before things are really done? Without extra tooling the dev easily misses that the called async did exactly nothing and lets proceed the code as if. Fail!

    2/n

    #javascript #typescript #async #await #asyncawait

  5. CW: a rant with expletives about JavaScript

    TypeScript is fun, but often I hate the JavaScript async/await crap.

    Background: journal.stuffwithstuff.com/201

    Async is like mold spreading through the code base. On top of it: why is it called **await** and not **return-immediately-with-a-fucking-promise**? ...

    1/n

    #javascript #typescript #async #await #asyncawait

  6. Как старый роутер съел 2.5 ГБ ОЗУ в моей вкладке, или cетевой инфаркт асинхронного кода

    Интро Это история о том, как «кривой» роутер научил меня смотреть на память браузера иначе. Есть вкладка с ИИ-чатом, есть WebSocket/Streaming, есть обычный i5. И есть момент, когда все это превращается в кирпич: вкладка раздувается до гигабайтов, процессор залипает, страница оживает только на пару минут после перезагрузки. Лид Проблема оказалась не в нейросетях и не в JS. Виновник — старый домашний роутер, который не вывозил IPv6 и фрагментацию. Итог — застрявшие пакеты, нарастающий буфер в браузере и тысячи незавершенных async/await -машин в памяти. TL;DR - Вкладка с WebSocket раздувается из-за сетевых затыков. - Роутер ломает MTU/IPv6, пакеты зависают, bufferedAmount растет. - Асинхронные цепочки не завершаются и копятся в Heap. - Фикс: MTU 1400 + отключение IPv6. - В коде: мониторинг bufferedAmount , таймауты и AbortController . Симптом - Вкладка с ИИ-чатом пухнет до 1–2.5 ГБ. - CPU уходит в 100%, интерфейс замирает. - Перезагрузка помогает на 5 минут, дальше все повторяется.

    habr.com/ru/articles/988398/

    #websocket #javascript #network #performance #asyncawait #memory

  7. 🛠️🎉 #Zig finally got its Async/Await back! 🙄 The world's most anticipated feature for a #language no one's heard of—because, obviously, we don't have enough async/await in other languages. 😂 But hey, #compiling from the master branch makes you a real programmer, right? 🤓✨
    charlesfonseca.substack.com/p/ #AsyncAwait #Programming #DeveloperHumor #HackerNews #ngated

  8. #TIL about #ResonateHQ;

    resonatehq.io/

    No, not the moribund music streaming co-op, the developers describe their project as;

    "An open-source implementation of Distributed Async Await."

    An open protocol described in a diagram here;

    resonatehq.io/distributed-asyn

    ... which extends the pre-existing Async Await.

    (Yes, I learned about all of this for the first time today and I'm still not entirely sure what it is).

    #AsyncAwait #DistributedAsyncAwait

  9. timers.promises в Node.js

    Привет, Хабр! Сегодня мы рассмотрим один из тех маленьких, но мощных апгрейдов Node.js, который вы, скорее всего, недооценивали. Речь о timers.promises — свежем и способе работать с setTimeout и setImmediate в асинхронных функциях.

    habr.com/ru/companies/otus/art

    #nodejs #программирование #timerspromises #setTimeout #setImmediate #AbortSignal #asyncawait #таймеры_в_Nodejs

  10. 🚀 Mastering API Handling in React & Vanilla JS – One Step at a Time!

    This week, I deep-dived into handling APIs in React and Vanilla JavaScript – not just fetching data, but doing it efficiently and securely which includes: Fetch, CRUD, Query Params, Auth, and AbortController Explained

    #ReactJS #JavaScript #WebDevelopment #Frontend #APIs #AbortController #Authentication #Authorization #AsyncAwait #LinkedInLearning #100DaysOfCode

    dev.to/shubhamtiwari909/handli

  11. Async to run background function or task in C# Tip #40 Using async and Task in C# to run a background function while the main method continues executing a counter until the background task completes. #CSharp #AsyncAwait #Multithreading #Task #DotNet #BackgroundProcessing

  12. Async and Await Non-Blocking UI in C# Tip #39 Using async and await in C# keeps the UI responsive during long tasks like delays. Without them, the UI freezes and becomes unresponsive until the task is complete. #CSharp #AsyncAwait #ResponsiveUI #ProgrammingTips #DotNet #vscode

  13. Почему джуны путаются в асинхронном коде (и как научиться с ним работать)

    Асинхронный код часто становится камнем преткновения для начинающих разработчиков. Почему функции выполняются не в том порядке, зачем нужны промисы, и что делает async/await? В статье я простыми словами объясняю: - Как работает Event Loop и почему это важно. - Какие ошибки чаще всего допускают джуны при работе с асинхронностью. - Как научиться писать понятный и предсказуемый асинхронный код. Если асинхронность вызывает больше вопросов, чем ответов, загляните в статью - там всё по шагам. 🙂

    habr.com/ru/articles/871328/

    #Асинхронность #javascript #event_loop #промисы #callbacks #вебразработка #отладка_кода #обучение_программированию #asyncawait

  14. 🚀 New blog post alert! Dive into the world of concurrency in Rust with our latest article: Navigating Concurrency in Rust: The Complex Dance of Async/Await and Threads 💻
    eliza-ng.me/post/asyncawaitthr
    #RustLang #Concurrency #AsyncAwait #Threads

  15. Marco Sanna zeigt in seinem Vortrag "Von UIKit zu SwiftUI - Eine Refactoring Reise" auf der #Macoun23 am Beispiel einer aktiv genutzten Produktivapp, wie eine komplexe Änderung der Architektur ohne Einschränkungen für Benutzer und Entwicklungsteam umgesetzt werden kann.

    Sei dabei: macoun.de/anmelden

    #SwiftUI #Storyboards #RxSwift #CleanArchitecture #AsyncAwait #macounFFM

  16. Can a Swift async method return multiple results over time? Different types, so I don’t think I can use AsyncSequence? Something like (pseudocode)

    let (showProgress: async Bool, result: async MyThing) = await doSomethingLengthy()
    if await showProgress {
    showProgressScreen()
    }
    processResult(await result)

    ?

    doSomethingLengthy() would guarantee that doProgress is fulfilled before result, in case that helps.

    Or must it be a 2-method delegate?

    #swiftlang #programming #asyncAwait #coroutines

  17. @helge hiding the tags is a bad idea. People often use tags as part of the content. E.g. “#asyncAwait is awesome in #Swift” which would show up for you as “is awesome in”.

  18. Since XCTest does not support async expressions in its assert functions I released SwiftAsyncAsserts Swift package to fill that gap.

    Write more readable testing code for your async type interfaces in Swift.

    github.com/angu-software/Swift

    #swift #xctest #asyncawait #unittest

  19. Swift Concurrency 🚅

    We deal with async/await code every day. We use Task. But we don't often think about Task inheritance. 🤘

    - Tasks inherit the parent task’s attributed, like priority, actor.
    - Cancelling a parent task automatically cancels the child task.
    - Detached Tasks don't inherit anything and you're responsible for cancelling them (in child task context)

    And it's better to avoid detached task if it’s possible

    #Swift #SwiftUI #AsyncAwait #Concurrency

  20. The fact that there is a thing called "megaYield" to work around async/await problems in swift is just sad.

  21. Just went through [Unit testing Asynchronous Code in Swift] by @tundsdev on this video:

    youtube.com/watch?v=P4Zee8weKV

    Absolutely brilliant, clear and concise explanation. I would highly recommend it. 👌🏾

    Got me doing a bit of refactoring on some of my unit tests too. Even more so, I discovered that Apple did release an Async/Await API for HealthKit (starting with iOS v15) and I went ahead and made a bunch of code updates there too.

    #swift #swiftdev #bdd #tdd #asyncawait