並び順

ブックマーク数

期間指定

  • から
  • まで

81 - 120 件 / 278件

新着順 人気順

asyncの検索結果81 - 120 件 / 278件

  • Async/Await functions in Ruby

    Async/Await functions in Ruby Sat, Dec. 14th, 2019 @平成Ruby会議01

      Async/Await functions in Ruby
    • GitHub - emacs-ng/emacs-ng: A new approach to Emacs - Including TypeScript, Threading, Async I/O, and WebRender.

      You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert

        GitHub - emacs-ng/emacs-ng: A new approach to Emacs - Including TypeScript, Threading, Async I/O, and WebRender.
      • The State of Async Rust: Runtimes | corrode Rust Consulting

        Recently, I found myself returning to a compelling series of blog posts titled Zero-cost futures in Rust by Aaron Turon about what would become the foundation of Rust's async ecosystem and the Tokio runtime. This series stands as a cornerstone in writings about Rust. People like Aaron are the reason why I wanted to be part of the Rust community in the first place. While 2016 evokes nostalgic memor

          The State of Async Rust: Runtimes | corrode Rust Consulting
        • Async Clipboard API

          Safari 13.1 adds support for the async Clipboard API. This API allows you, as web developers, to write and read data to and from the system clipboard, and offers several advantages over the current state of the art for reading and writing clipboard data via DataTransfer. Let’s take a look at how this new API works. The API The Clipboard API introduces two new objects: Clipboard, which is accessibl

          • JSの初心者にPromiseとasync/awaitの使い方を雑に説明してみる | DevelopersIO

            こんにちは、CX事業本部の夏目です。 先日、Javascriptの非同期処理に登場するPromiseとasync/awaitをJS初心者に説明する機会がありました。 なので、今回は説明したことを再度噛み砕いてから共有しようと思います。 Promiseの使い方 基本的な使い方 main.js function sleep(sec) { return new Promise((resolve, reject) => { setTimeout(() => { console.log(`wait: ${sec} sec`); resolve(sec); }, sec * 1000); }); } function main() { sleep(2).then((data) => { return sleep(data * 2); }).then((data) => { console.log(`s

              JSの初心者にPromiseとasync/awaitの使い方を雑に説明してみる | DevelopersIO
            • I'm not feeling the async pressure

              I'm not feeling the async pressure written on Wednesday, January 1, 2020 Async is all the rage. Async Python, async Rust, go, node, .NET, pick your favorite ecosystem and it will have some async going. How good this async business works depends quite a lot on the ecosystem and the runtime of the language but overall it has some nice benefits. It makes one thing really simple: to await an operation

              • Building a shared vision for Async Rust | Rust Blog

                The Async Foundations Working Group believes Rust can become one of the most popular choices for building distributed systems, ranging from embedded devices to foundational cloud services. Whatever they're using it for, we want all developers to love using Async Rust. For that to happen, we need to move Async Rust beyond the "MVP" state it's in today and make it accessible to everyone. We are laun

                  Building a shared vision for Async Rust | Rust Blog
                • Tonic: gRPC has come to async/await!

                  Tonic: gRPC has come to async/await! I am pleased to finally announce a crate that I have been working very hard on for the past few months. tonic has finally hit the initial 0.1.0-alpha.1 release! Stable releases will follow in the coming months. What is Tonic? Tonic is a gRPC-over-HTTP/2 implementation focused on high performance, interoperability, and flexibility. This library was created to ha

                  • Rustが1.39でゼロコストAsync/Awaitをサポート

                    Spring BootによるAPIバックエンド構築実践ガイド 第2版 何千人もの開発者が、InfoQのミニブック「Practical Guide to Building an API Back End with Spring Boot」から、Spring Bootを使ったREST API構築の基礎を学んだ。この本では、出版時に新しくリリースされたバージョンである Spring Boot 2 を使用している。しかし、Spring Boot3が最近リリースされ、重要な変...

                      Rustが1.39でゼロコストAsync/Awaitをサポート
                    • C# の Web アプリで async/await を使わないとどれくらい性能劣化するか見てみよう(.NET Framework編)

                      前に ASP.NET Core で非同期と同期で3秒待ってレスポンス返すだけのプログラムを書いて Azure の Web Apps にデプロイして結果を見るという事をやりました。 今回は、これの ASP.NET 4.8 編になります。 デプロイした Web API 純粋に Thread.Sleep(3000); で待つものと await Task.Delay(3000); で待つものの二種類を作りました。ASP.NET 4.8 の Web API のテンプレートで出力される ValuesController の Get() メソッドに対して上記の2種類のコードを追加しています。 同期版 using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Net.H

                        C# の Web アプリで async/await を使わないとどれくらい性能劣化するか見てみよう(.NET Framework編)
                      • Why I’m building a new async runtime | Stjepan’s blog

                        Rust has a relatively new async/await system, and one of its peculiarities is that it doesn’t have a runtime baked in like many other programming languages do. To write an async program, you have to pick a library like async-std or tokio, or implement a runtime on your own. The apparent competition between async-std and tokio to become the one true runtime has created the dreaded ecosystem split,

                        • JavaScriptのasync/awaitを完全に理解する

                          はじめにこんにちは. Acompanyの湯浅です. 今回はJavaScriptを書く時になんとなくで済ませがちなasync/awaitについて解説します. 非同期処理async/awaitの解説に入る前に理解するべきことが2つあります. 1つは非同期処理です. 非同期処理とは「ある関数が呼ばれた時に, 返り値として渡したい値を返すのではなく一度関数として終了し, 渡したい値を返せる状態になったら呼び出し元にその値を返す」というものです. イメージとして電子レンジを思い浮かべると良いでしょう. 電子レンジでおにぎりを温める時, 私たちはタイマーをセットして一旦待ちます. これが「関数として一度終了している状態」です. そして, 時間が経つとおにぎりが食べられる状態になります. これが「渡したい値を返せるよう状態になったらその値を返す」ということです. Promiseasync/awaitの解

                          • Different levels of async in Rust - FP Complete

                            First there was cooperative multiprocessing. Then there were processes. An operating system could run multiple processes, each performing a series of sequential, blocking actions. Then came threads. A single processes could spawn off multiple threads, each performing its own series of sequential, blocking actions. (And really, the story starts earlier, with hardware interrupts and the like, but ho

                              Different levels of async in Rust - FP Complete
                            • decoding="async"の使い方とloading="lazy"との違いのまとめ

                              概要 画像のデコードは、ブラウザのメインスレッドをブロックします。こちらの記事では、例としてブラウザのメインスレッドが800ミリ秒を超えてブロックされています。 decoding="async" は、その解決策として使うことができます。 loading属性との違い loading属性は、loading="lazy"と使うことによって画像の遅延読み込み化ができます。 loading属性は「画像をいつ読み込むか?」という画像の読み込みのタイミングを担当しますが、decoding属性は「画像をいつデコードするか?」という画像のデコードのタイミングを担当します。 loading=lazyとdecoding="async"の併記 loading="lazy"とdecoding="async"は併用することができます。 注意点としては、デコードのタイミングが遅れることによって、スクロール時に画像が表示

                                decoding="async"の使い方とloading="lazy"との違いのまとめ
                              • [JS]なぜawaitはasync関数の中にしか書けないのか - Qiita

                                先に結論 awaitが使われている関数はジェネレータとして内部的に変換され、非同期処理になる。 その為、async関数である必要がある。 コンパイラから見ても、asyncが付いていることで効率的にコンパイルできる。 (追記 2021/07/21)最上位でのawaitは、もうすぐ可能になるかもしれない(一部ブラウザは実装済)。(鶏(async)が先か卵(await)が先かでコメントで教えて頂きました。感謝!) というわけで本編 awaitはPromiseを返す関数を呼び出す方法として非常に便利ですが、それを使う箇所にはいちいちasyncを付けて回らなければならないのが面倒だと思ったことはないでしょうか。 そもそもawaitを内部で使っている関数が常にasyncである必要性がいまいちピンと来ない方もいるのではないでしょうか(最初にasync/awaitの構文を見た時、私自身がそうでした)。 例

                                  [JS]なぜawaitはasync関数の中にしか書けないのか - Qiita
                                • script要素の新常識・安易にdefer/async属性を付けてはいけない - Qiita

                                  script要素の位置とasync/defer script要素はbodyの末尾に記述するのが定説ですが、あるサイトについてscript要素の記述位置やasync/deferが及ぼすパフォーマンスへの影響を実験しました。 外部JavaScript 11ファイル・250kb 因子1 head要素内・body要素の末尾を比較 因子2 defer・async・それらの属性なしを比較 いずれのケースもスクリプトエラーがなく期待通りに動作 PageSpeed Insightsのモバイルスコアで評価 ※ この記事ではscript要素はsrc属性で外部参照することを前提にします。インラインスクリプトではありません。 ※ また、1サイトでの結果に過ぎないのでその点も考慮ください。 最速はasync付きでhead要素に記述 PageSpeed Insightsのスコアはばらつきが出るので、10回の計測を行い

                                    script要素の新常識・安易にdefer/async属性を付けてはいけない - Qiita
                                  • Swift の「async let ...」と「TaskGroup」の使い分け早見表

                                    /// `TaskGroup` を使って実装された `race(lhs:rhs:)` /// 本文中に実装を掲載しています let result = await race( lhs: { try? await Task.sleep(for: .seconds(100)) return 100 }, rhs: { try? await Task.sleep(for: .seconds(1)) return 1 } ) print(result) // 1 /// 同期的に `Int` が返ります(処理に0秒かかるとする、同期関数) func num0() -> Int { return 0 } /// 非同期的に `Int` が返ります(処理に1秒かかるとする、非同期関数) func num1() async -> Int { try! await Task.sleep(for: .seco

                                      Swift の「async let ...」と「TaskGroup」の使い分け早見表
                                    • Single-threaded async Rust | Gerard Rodes

                                      This domain may be for sale!

                                      • 「Django Async Viewって何がおいしいの?」 知ってしまえば怖くない非同期IO処理“asyncio”

                                        「DjangoCongress JP」は日本で開催されるDjango Webフレームワークのカンファレンスです。参加する全ての人がDjangoについて交流し、出会い、学び、楽しみ、深い理解を得ることを目的にしています。福田氏は、Django 3のASGI対応について発表しました。全2回。前半は、ASGI対応の概要とasyncioの基礎について話しました。 Django 3の目玉の1つ「ASGI対応」 福田隼也氏:「Django 3.2 ASGI対応 - こわくないasyncio基礎とasync viewの使い所」ということで、今日お話しします。福田です、よろしくお願いします。 まずお前誰だよというところで、福田隼也と申します。「Twitter」は@JunyaFffといいます。長野県の会社の株式会社日本システム技研に所属しています。 Webエンジニアをしていて、弊社の運営する「GEEKLAB

                                          「Django Async Viewって何がおいしいの?」 知ってしまえば怖くない非同期IO処理“asyncio”
                                        • 僕でもわかるasync/await - Qiita

                                          サルでも分かるで挫折し、ミジンコでも分かるで挫折したわたしに。 サル > ミジンコ > 僕 僕でも分かるasync/awaitまとめました。 モダンブラウザで動きます。Developer Toolのコンソールで試してみてください。 (本記事のサンプルはgoogle.comドメインのページでお試しください。googleさんお邪魔します) fetch APIで試す ブラウザからAjaxリクエストなどに使えるfetch APIで試します。 jQueryなどのAjax通信を思い出すと、レスポンスを取得した際のロジックはコールバック関数で定義しますね。fetchを使うと以下のように同期処理っぽく書けます。 (async () => { const response = await fetch("https://www.google.com") const html = await response.

                                            僕でもわかるasync/await - Qiita
                                          • async/await は Promise を置き換えることは出来ると思う - Qiita

                                            2020/12/16 追記 冒頭の元記事のプログラムを読み間違えていて、真面目に読むといきなり仕様とは異なるプログラムを書いてしまっていますorz その旨を指摘していただいたコメントがコメント欄にあるのですが、そちらの方がコードとしては面白いことになってるのでコメントまで合わせて読むのがおすすめです。 本文 この記事は、以下の記事を読んだ自分の感想です。割と反対意見が多めです。 async/await は Promise を置き換えない あと、元々 C# 畑の人間なので、この記事で TypeScript を使ってますが、もしかしたら冗長な書き方や、そもそも勘違いをしてしまっている可能性があります。その場合はコメントなどで教えてください。 そもそも、async/await は Promise を置き換えるものではなくて、どちらかというと then/catch/finally のメソッドチェー

                                              async/await は Promise を置き換えることは出来ると思う - Qiita
                                            • [小ネタ]forEachではasync/awaitが使えない | DevelopersIO

                                              IoT事業部の木村です。 DynamoDBからGetItemをするという処理を書いていて、forEachの中でasync/awaitが効かないということに気づかず非常に多くの時間を使ってしまいました。大変基礎的でお恥ずかしい内容ですが、今後の備忘のために書き記しておきます。 Array.prototype.forEach() 実行環境 node.js v12.22.1 準備 「test」という名前のDynamoDBテーブルを作成して、idだけの単純なデータを1000件入れておきます。 動かなかったコード ということで、動かなかったコードは以下の通りです。 forEachは非同期処理に対応した設計をされていないようです。 const AWS = require('aws-sdk'); AWS.config.update({ region: 'ap-northeast-1' }); const

                                                [小ネタ]forEachではasync/awaitが使えない | DevelopersIO
                                              • Rails 6.1: 関連付けをバックグラウンド削除する「dependent: :destroy_async」(翻訳)|TechRacho by BPS株式会社

                                                2021.01.18 Rails 6.1: 関連付けをバックグラウンド削除する「dependent: :destroy_async」(翻訳) 概要 原著者の許諾を得て翻訳・公開いたします。 英語記事: Rails 6.1 adds support for destroying dependent associations in the background | Saeloun Blog 原文公開日: 2020/11/18 著者: Prasad Walvekar サイト: Saeloun Blog | Ruby on Rails Consulting Company based in San Francisco and Boston 日本語タイトルは内容に即したものにしました。 Rails 6.1: 関連付けをバックグラウンド削除するdependent: :destroy_async(翻訳)

                                                  Rails 6.1: 関連付けをバックグラウンド削除する「dependent: :destroy_async」(翻訳)|TechRacho by BPS株式会社
                                                • babel 環境における Polyfill のビルド最適化と async-await の扱い - blog.euxn.me

                                                  リポジトリ euxn23/babel-and-polyfill-sample 想定読者 Babel を使っているが、 Polyfill がいまいちわからない方 Polyfill は使えるが、より最適なビルドを生成したい方 @babel/polyfill が非推奨になったことを受け現在の推奨実装を知りたい方 Polyfill とは 例として、以下の Promise を使ったコードを、 @babel/preset-env を使用して IE11 向けにビルドします。 input const main = () => { Promise.resolve().then(() => console.log('then')); } main(); output "use strict"; var main = function main() { Promise.resolve().then(functi

                                                    babel 環境における Polyfill のビルド最適化と async-await の扱い - blog.euxn.me
                                                  • Express.jsでasync/awiatをいい感じに使う - ishikawa_pro's memorandum

                                                    はじめに お久しぶりです。 最近は業務でTypeScriptを書き始めたりしてました。 今日は、会社のテックブログに載せるつもりで書いてみたけど、内容的に会社のブログで載せるほどの内容にならず、ボツにした記事をここで供養しようと思いますw ちなみに、会社のテックブログに書いた内容はこちら 👇 https://cam-inc.co.jp/p/techblog/407753782164718758 Express.jsのTIPS紹介 ということで今日は、Express.jsのtipsを1つ紹介します。 Express.jsとは まず簡単にExpress.jsの説明です。 Express.jsは、Node.js製の薄いWebアプリケーションフレームワークです。 https://expressjs.com/ja/ とりあえず、これだけ書けばサーバーを動かすことができます。 const expre

                                                      Express.jsでasync/awiatをいい感じに使う - ishikawa_pro's memorandum
                                                    • Combineの非同期処理をSwift Concurrencyのasync/awaitで書き換えてみた - ZOZO TECH BLOG

                                                      こんにちは、FAANS部の中島 (@burita083) です。2021年10月に中途入社し、FAANSのiOSアプリの開発を行なっています。 FAANSの由来は「Fashion Advisors are Neighbors」で、「ショップスタッフの効率的な販売をサポートするショップスタッフ専用ツール」です。現在正式リリースに向けて、WEARと連携したコーディネート投稿機能やその成果を確認できる機能など開発中です。 はじめに FAANS iOSでは非同期処理にCombineを利用しています。Combine自体は本記事では詳しく解説をしませんが、RxSwiftを利用したことがある方なら特に違和感なく使えるかと思います。全く馴染みがない場合だと覚えることも多く、難しいところもあるかと思いますので、Swift Concurrencyを利用する方が理解しやすいかもしれません。ただし、ViewとPr

                                                        Combineの非同期処理をSwift Concurrencyのasync/awaitで書き換えてみた - ZOZO TECH BLOG
                                                      • 先取り! Swift 6 の async/await

                                                        Swift の async/await の Proposal が Accept されました。これによって、 Swift に async/await が導入されることが決定しました。おそらく、 Swift 6 で導入されるものと思われます。 本スライドは https://www.youtube.com/watch?v=OZN_YFZy770&t=1467 の動画と合わせて御覧下さい。 Swift の async/await の解説と練習問題を実施しています。練習問題は、実務で async/await を使うことになりそうなケースを取り上げています。 また、練習問題と解答例のソースコードは https://github.com/koher/async-await-challenge からもご覧いただけます。

                                                          先取り! Swift 6 の async/await
                                                        • Async/Await | Writing an OS in Rust

                                                          In this post, we explore cooperative multitasking and the async/await feature of Rust. We take a detailed look at how async/await works in Rust, including the design of the Future trait, the state machine transformation, and pinning. We then add basic support for async/await to our kernel by creating an asynchronous keyboard task and a basic executor. This blog is openly developed on GitHub. If yo

                                                          • GitHub - bytedance/monoio: Rust async runtime based on io-uring.

                                                            Monoio is a pure io_uring/epoll/kqueue Rust async runtime. Part of the design has been borrowed from Tokio and Tokio-uring. However, unlike Tokio-uring, Monoio does not run on top of another runtime, rendering it more efficient. Moreover, Monoio is designed with a thread-per-core model in mind. Users do not need to worry about tasks being Send or Sync, as thread local storage can be used safely. I

                                                              GitHub - bytedance/monoio: Rust async runtime based on io-uring.
                                                            • JavaScriptの配列のmapでasync/awaitを使う方法 - Qiita

                                                              mapから呼び出す関数をasyncにする mapから呼び出す関数の中はawaitを使って同期処理にする mapから生成された配列をPromise.allに格納する Promise.allをawaitで受ける 例 // ダミー処理 function funcPromise(b){ return new Promise((resolve, reject)=>{ if(b){ resolve("OK"); } else { reject("ERROR"); } }); } (async ()=>{ const array = [1,2,3]; const result = await Promise.all(array.map(async (v)=>{ const dummy = await funcPromise(true); return dummy; })); console.log(re

                                                                JavaScriptの配列のmapでasync/awaitを使う方法 - Qiita
                                                              • Async-Awaitifying a Rust CLI App - zupzup

                                                                Async-Awaitifying a Rust CLI App In a previous post we built a CLI app using rust. This app used both an HTTP API using the asynchronous hyper library, as well as GIT using the synchronous git2. In this post, we’ll port the whole app to the new async/await syntax in the hope that the interplay between asynchronous and synchronous program flow becomes easier to handle as well as that the complexity

                                                                • [javascript] なぜ「forEachでasync/awaitは使えない」と言われるのか - Qiita

                                                                  はじめに とあるメンバーから、表題のようなことを言われました。 どうやら以下のようなコードで、「forEachでawaitを使っているのに処理順がおかしくなる」とのことから、この結論に至ったそうです。 async function testAsync(v) { await new Promise(resolve => { setTimeout(resolve, 100); }); return v + 1; } const data = []; const params = [0, 1, 2]; params.forEach(async v => { const res = await testAsync(v); console.log(res); data.push(res); }); console.log(data); // [] 1 2 3 彼としてはawaitによって非同期処理の

                                                                    [javascript] なぜ「forEachでasync/awaitは使えない」と言われるのか - Qiita
                                                                  • async/await周りで苦しんだ箇所の例と対策 | DevelopersIO

                                                                    どうも。CX事業本部Delivery部のえーたん(@eetann092)です。 今まで雰囲気でJavaScript(TypeScript)のasync/await、Promiseを使っていて最近苦しんだため、ハマったところの例と対策を備忘録として残しておきます。 await付け忘れ やらかした例 まず、awaitを付け忘れた例です。 import { setTimeout } from "timers/promises"; const unit = 1000; async function logSleepLog(msg: string) { console.log(msg); await setTimeout(1.5 * unit); console.log(msg); } (async () => { logSleepLog("hoo"); console.log("finish");

                                                                      async/await周りで苦しんだ箇所の例と対策 | DevelopersIO
                                                                    • 週刊Railsウォッチ(20210222)ActiveRecord::Relationの新メソッドload_asyncとexcluding、Active Jobのperform_laterの改善ほか|TechRacho by BPS株式会社

                                                                      週刊Railsウォッチについて 各記事冒頭には🔗でパーマリンクを置いてあります: 社内やTwitterでの議論などにどうぞ 「つっつきボイス」はRailsウォッチ公開前ドラフトを(鍋のように)社内有志でつっついたときの会話の再構成です👄 お気づきの点がありましたら@hachi8833までメンションをいただければ確認・対応いたします🙇 TechRachoではRubyやRailsのなど最新情報記事を平日に公開しています。TechRacho記事をいち早くお読みになりたい方はTwitterにて@techrachoのフォローをお願いします。また、タグやカテゴリごとにRSSフィードを購読することもできます(例:週刊Railsウォッチタグ) 🔗Rails: 先週の改修(Rails公式ニュースより) 今回は以下のコミットリストのChangelogを中心に見繕いました。 コミットリスト: Compa

                                                                        週刊Railsウォッチ(20210222)ActiveRecord::Relationの新メソッドload_asyncとexcluding、Active Jobのperform_laterの改善ほか|TechRacho by BPS株式会社
                                                                      • GitHub - justjake/quickjs-emscripten: Safely execute untrusted Javascript in your Javascript, and execute synchronous code that uses async functions

                                                                        Javascript/Typescript bindings for QuickJS, a modern Javascript interpreter, compiled to WebAssembly. Safely evaluate untrusted Javascript (supports most of ES2023). Create and manipulate values inside the QuickJS runtime (more). Expose host functions to the QuickJS runtime (more). Execute synchronous code that uses asynchronous functions, with asyncify. Github | NPM | API Documentation | Variants

                                                                          GitHub - justjake/quickjs-emscripten: Safely execute untrusted Javascript in your Javascript, and execute synchronous code that uses async functions
                                                                        • async-std - Stop worrying about blocking: the new async-std runtime, inspired by Go

                                                                          Note: This blog post describes a proposed scheduler for async-std that did not end up being merged for several reasons. We still believe that the concept holds important insight and may circle back to it in the future, so we keep it online as it. async-std is a mature and stable port of the Rust standard library to its new async/await world, designed to make async programming easy, efficient, worr

                                                                          • Why async Rust?

                                                                            Async/await syntax in Rust was initially released to much fanfare and excitement. To quote Hacker News at the time: This is going to open the flood gates. I am sure lot of people were just waiting for this moment for Rust adoption. I for one was definitely in this boat. Also, this has all the goodness: open-source, high quality engineering, design in open, large contributors to a complex piece of

                                                                            • Async Exceptions in Haskell, and Rust - FP Complete

                                                                              Before getting started: no, there is no such thing as an async exception in Rust. I’ll explain what I mean shortly. Notice the comma in the title :). GHC Haskell supports a feature called asynchronous (or async) exceptions. Normal, synchronous exceptions are generated by the currently running code from doing something like trying to read a file that doesn’t exist. Asynchronous exceptions are gener

                                                                                Async Exceptions in Haskell, and Rust - FP Complete
                                                                              • How Rust optimizes async/await I

                                                                                Aug 18, 2019 The issue to stabilize an initial version of async/await in Rust has left final comment period. The feature looks slated to stabilize in an upcoming release, most likely 1.39. This represents the culmination of an enormous amount of work by people all over the Rust community. But it’s also only the beginning of async/await support in Rust. The feature set being stabilized is a “minimu

                                                                                • 【非同期処理】JavaScriptのPromise, async, awaitなどについての整理と使い方 - Qiita

                                                                                  【非同期処理】JavaScriptのPromise, async, awaitなどについての整理と使い方JavaScriptpromise非同期処理asyncawait 非同期処理/同期処理について C言語やPythonから入った私はコードは上から順に実行されるものだと思っていました。しかし、JavaScriptはクライアントサイドの言語であり、 「ページ更新などレスポンスの即時性が求められているため非同期処理である」 とのことです。 ~同期処理とは~ コードを上から順に処理していき、「サーバとのデータのやりとりなど時間がかかる作業を待って次の処理を行う」といったイメージです。 ~非同期処理とは~ 原則的にコードは上から順に処理していきますが、「サーバとのデータのやりとりなど時間がかかる作業と並行して次の処理を行う」 ※詳細なイメージは@don-bu-rakkoさんの以下をご参考にして頂け

                                                                                    【非同期処理】JavaScriptのPromise, async, awaitなどについての整理と使い方 - Qiita