並び順

ブックマーク数

期間指定

  • から
  • まで

321 - 360 件 / 792件

新着順 人気順

promiseの検索結果321 - 360 件 / 792件

  • JavaScriptでScalaのFutureを表現する

    はじめに Scala.jsというプロジェクトがあります。 Scalaで書いたプログラムをJavaScriptに変換する、とてもクールなツールです。 ただ、もちろん言語自体が違うため、完全なマッピングが可能な訳ではありません。ベストエフォートでセマンティクスを維持したままJavaScriptに変換しますが、いくつか対応付けが困難なケースがあります。 その中でも特にScalaの Future をJavaScript上でどのように表現するか? という点に関しては、JavaScriptの深みを知れるとても良い題材だと思ったので、まとめてみようと思います。 ※ 一応Scala.jsをネタに出してますが、Scalaを知らなくても理解できるように書いたつもりです。 ScalaのFuture Scalaには並列処理を行うためのデータ型として Future があります。 Future は、ある時点において利

      JavaScriptでScalaのFutureを表現する
    • Bye Bye Javascript Promises! | Codaholic

      In my previous post, I explored how programming with promises can be made close to programming with values. After some more work on it, and some learning from bluebird, I came to conclude that my brain doesn’t think well with promises. So I wrote a macro for Javascript that expands “tasks” into async state machines that communicate using channels (i.e. CSP). I want to talk about the specific optio

      • Node, Promises and Functional Programming

        東京Node学園 8時限目 ”Nodeとプロミスと、時々、関数型” by @okapies http://connpass.com/event/2125/

          Node, Promises and Functional Programming
        • Havoc Pennington「同期的コールバック、非同期コールバック 」 - 以下斜め読んだ内容

          ometer.com 2011.07.24のブログエントリ Callbacks, synchronous and asynchronous : Havoc's Blog 2011年7月からnodeコアチーム7人のうちの1人になってたid:koichik(@koichik)さんが良記事認定してたエントリ コアチームの人たちは、Joyentからは2人。ryan(@ryah)、npmの人(@izs)。Cloudkickからも2人。Bert Belder(@piscisaureus)にPaul Querna。それにBen NoordhuisとFelix Geisendörferに@koichik。 informativeな内容だが歯が立たない。けど何とか斜め読んでみた 以下斜め読んだ内容 このエントリ コールバック使ったAPIデザインで守った方がいいルール2つ 同じテーマで細々したところは前に書い

            Havoc Pennington「同期的コールバック、非同期コールバック 」 - 以下斜め読んだ内容
          • HealthKit + PromiseKit事始め 基本的なデータの読み書き | Technology-Gym

            iOS8からHealth.appとHealthKitというフレームワークが追加されました。 HealthKitはCoreDataのようなアプリ間で共有できる健康データの読み書きや健康情報に関する単位やformatter、統計計算が行えるフレームワークです。 HealthKit – Apple Developer HealthKitが扱う範囲は幅広いため、この記事ではデータの書き込みと読み込みを例にHealthKitの基本的な使い方について学んで行きたいと思います。 2014年7月25日(金)に第1回 Tech-Gym byプラスアール @SMS 【iOS勉強会、開発者向け】 : ATNDというイベントで、Healthkitについて喋ります。 詳細はTech-GymというiOS勉強会を開催しますの方を見て下さい。 基本的なクラス HealthKitではかなりの数のクラスや単位の定義等が用意さ

              HealthKit + PromiseKit事始め 基本的なデータの読み書き | Technology-Gym
            • jQuery 3.0 Release Candidate…Released! | Official jQuery Blog

              Welcome to the Release Candidate for jQuery 3.0! This is the same code we expect to release as the final version of jQuery 3.0 (pending any major bugs or regressions). When released, jQuery 3.0 will become the only version of jQuery. The 1.12 and 2.2 branches will continue to receive critical support patches for a while, but will not get any new features or major revisions. Note that jQuery 3.0 wi

              • SwiftTask(Promise拡張)を使う - Qiita

                使用例 SwiftTaskでタスクを定義する際(初期化クロージャ内)、直接Grand Central Dispatch等を使って非同期処理を行うことも可能です。 が、Alamofire(ネットワークライブラリ)に代表されるような、 obj.setProgressHandler() (callback) obj.setCompletionHandler() (callback) obj.pause() obj.resume() obj.cancel() のAPIの形に「別クラスで一旦ラップする」方が、より簡単に実装することができます。 Alamofireを使った例 typealias Progress = (bytesWritten: Int64, totalBytesWritten: Int64, totalBytesExpectedToWrite: Int64) // define ta

                  SwiftTask(Promise拡張)を使う - Qiita
                • RxJS Real World // Speaker Deck

                  All slide content and descriptions are owned by their creators.

                    RxJS Real World // Speaker Deck
                  • JavaScriptのasync/awaitがPromiseよりもっと良い - Qiita

                    Deleted articles cannot be recovered. Draft of this article would be also deleted. Are you sure you want to delete this article?

                      JavaScriptのasync/awaitがPromiseよりもっと良い - Qiita
                    • AffですべてのPromises/Generatorsを過去にする/そして何故我々は作用をモナドで抽象化すべきなのか - Qiita

                      PromiseやGeneratorのような機構を使ってもなお非同期処理は厄介だ、そしてもっとシンプルで便利な方法があるよ、という話です。前半の議論を元に、後半ではなぜプログラミング言語の作用をモナドで抽象すると便利なのかということの説明をしています。 関数型プログラミング言語は「副作用をなるべく減らすことで安全性を高めた言語」というように説明されることがありますが、すべての式が副作用を持たないという『純粋』関数型プログラミング言語が言語を参照透明にしてモナドを導入するのは決して「副作用はなるべく避けたほうが安全だから」という理由だけではないのです。長いですが、これでも結構削りました。 序盤戦・Promises/Generatorsの光と影 Promises/Generatorsで世界はちょっと平和になる かつてはJavaScriptの非同期処理はコールバック地獄に陥ったり様々なパターンが混

                        AffですべてのPromises/Generatorsを過去にする/そして何故我々は作用をモナドで抽象化すべきなのか - Qiita
                      • akaDAV - WebDAV module for Twisted

                        What is akaDAV akaDAV is a Python module that adds WebDAV functionality to the Twisted 1.3. It makes WebDAV server application programming easy in Python. Features Integrated with a built-in Web server (Twisted Web). Easy installation / configuration. SSL support by default. Automatic character encoding conversion for international clients. Upper-compatiblity to the Twisted Web Static resource, wh

                        • Promises in Swift - Rob - Medium

                          IntroductionIn this post, we’ll explore building a proof-of concept implementation of Futures and Promises. One of my favorite features of the Swift language is that functions are first-class citizens. Swift’s support for returning functions from functions, accepting functions as function parameters, and Swift’s support for closures let us do some neat things, one of which is building support for

                            Promises in Swift - Rob - Medium
                          • 橋本商会 » 色々なPromiseライブラリで1つずつ順番に処理する

                            最初、Qでなぜかcatchでエラーが捕まえられないぞ?と書いていたけど、require(‘q’).Promiseを使うんだと教えてもらった。ありがとうございます。 — 色々なNodeのライブラリがそれぞれで好きなPromiseライブラリ使ってるけど、それらのライブラリ達をいっしょにアプリ内で混ぜてつなげても大丈夫なのか?ちゃんと相互にthenでチェインしたりエラー捕まえたりできるのか? という事と、async.eachSeriesのようにURLのリストを1つずつ順番に処理完了するのを待ちながら処理していくのはPromiseでどうやって書くのかな? というのが気になっていたのでちょっと調べた。 勉強用リポジトリ https://github.com/shokai/promise-study 環境 node v0.10.29 + coffee-script v1.8.0 なのでまだPromis

                              橋本商会 » 色々なPromiseライブラリで1つずつ順番に処理する
                            • GitHub - alesgenova/post-me: 📩 Use web Workers and other Windows through a simple Promise API

                              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 - alesgenova/post-me: 📩 Use web Workers and other Windows through a simple Promise API
                              • Syncing Async

                                Syncing Async with Kyle Simpson Save 10% off ANY FITC event with discount code 'slideshare' See our upcoming events at www.fitc.ca I bet you think “callback hell” is about function nesting and levels of indentation. Not so much. I bet you’ve heard that Promises replace callbacks. Nope. We need some clarity on what async flow control is all about in JavaScript. We’ll explore the perils of “Inversio

                                  Syncing Async
                                • http://documentup.com/kriskowal/q/

                                  • Vercel: Build and deploy the best web experiences with the Frontend Cloud – Vercel

                                    Your complete platform for the web.Vercel provides the developer tools and cloud infrastructure to build, scale, and secure a faster, more personalized web. Your complete platform for the web.Vercel provides the developer tools and cloud infrastructure to build, scale, and secure a faster, more personalized web.

                                      Vercel: Build and deploy the best web experiences with the Frontend Cloud – Vercel
                                    • Researching the Performance costs of JavaScript MVC Frameworks | Filament Group, Inc., Boston, MA

                                      Researching the Performance costs of JavaScript MVC Frameworks Posted by John Bender 12/12/2014 At Filament Group, we’ve been very focused on website performance. We’ve long been curious about the performance of popular JavaScript MVC frameworks such as Angular, Backbone, and Ember, primarily because they offer elegant solutions to complex problems and we want to be able to use them in our own cli

                                        Researching the Performance costs of JavaScript MVC Frameworks | Filament Group, Inc., Boston, MA
                                      • React 17の新機能「Suspense」の仕組み Timeout付き非同期処理が可能に - ログミーTech

                                        2018年6月19日、第69回となる「HTML5とか勉強会」が開催されました。今回のテーマは「UIフレームワーク最前線」。Angular、Vue.js、Reactという3つのフレームワークにおける第一人者が一同に集い、それぞれの最新動向やおすすめポイントを語ります。「Suspense」に登場したのは、koba04氏。React 17より追加される新機能「Suspense」を、デモを交えつつ解説しました。 Suspenseとは何か?koba04氏:よろしくお願いします。「Suspense」というタイトルで話していきたいと思います。Suspenseを聞いたことがある方はどれぐらいいますか? (会場挙手) 数人ぐらいですね。ありがとうございます。 最初に自己紹介をさせていただきます。「koba04」というアカウントでやっています。 今はサイボウズで働いていて、フロントエンド周りいろいろやっていま

                                          React 17の新機能「Suspense」の仕組み Timeout付き非同期処理が可能に - ログミーTech
                                        • #10 node.js sideshow | mozaic.fm

                                          #10 Node.js SideShow Theme 第10回目の SideShow です。 @koichik さんの「ところでみんな Promise 好き?」から始まった、 Promise / Generator / Rxjs などの話題と、 Java の Future や Haskell の Monad との関係などの解説です。 エピソードの感想などは、 #mozaicfm までお願いします。 Guest @koichik @yosuke_furukawa Show Note 0:00 ~ : そもそもみんな Promise 好き? ES6 Promise WindJS カール・ヒューイット 1:40 ~ : そもそもの Promise とは? Java の Future Haskell の Thunk 7:30 ~ : 本当に Promise は必要なのか? Scala の Opti

                                            #10 node.js sideshow | mozaic.fm
                                          • Promiseを使った非同期ループ処理の書き方について

                                            JavaScriptで常に頭を悩ませるのが非同期処理ではないかと思います。非同期処理を幾つも実行したりすると、思ったタイミングで処理が走らないといったことが多々あります。 そんな中でループ処理になると、特に厄介ではないでしょうか。そこで今回はPromiseを使ったループ処理について紹介します。 0から10まで順番に処理をしたら抜けるループ 非同期処理でない場合は次のように書けます。 This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more

                                              Promiseを使った非同期ループ処理の書き方について
                                            • iOS/Android対応 Boltsを使って非同期処理を統一的に書く - Qiita

                                              Deleted articles cannot be recovered. Draft of this article would be also deleted. Are you sure you want to delete this article?

                                                iOS/Android対応 Boltsを使って非同期処理を統一的に書く - Qiita
                                              • node.jsで子プロセスを起動しまくってエラーにならないようにするモジュール - Qiita

                                                https://github.com/shibukawa/spawn-limit https://www.npmjs.com/package/spawn-limit spawn-limit というモジュールを作りました。node.jsのchild_process.spawn()の薄いラッパーで、通常のspawnはChildProcessオブジェクトを返して、そいつに色々イベント登録して・・・という使い方をするんですが、プロセスを起動したらthenが呼ばれるPromiseを返すモジュールです。 ブラウザでサーバ間通信のコールバックの管理をPromiseでやるのは問題になることはないと思います。ネイティブのレイヤーで同時通信数を絞ってくれるので、アプリレイヤーで細かいことを考える必要はないでしょう。 今回はnode.jsで外部プロセスを起動しまくるコードを書いたら、プロセス数制限に引っかかって

                                                  node.jsで子プロセスを起動しまくってエラーにならないようにするモジュール - Qiita
                                                • React Suspense

                                                  カオスに立ち向かう小規模チームの装備の選択〜フルスタックTSという装備の強み _ 弱み〜/Choosing equipment for a small team facing chaos ~ Strengths and weaknesses of full-stack TS~

                                                    React Suspense
                                                  • Swift for JavaScript Developers — Realm — a mobile database

                                                    About the content This content has been published here with the express permission of the author. This Tuesday JP Simard gave another talk for the Swift Language User Group (#SLUG) in San Francisco. Hosted by Pubnub, this meetup was a Swift talk for JavaScript developers. JP began with a brief overview of some similarities and differences between Swift and JavaScript. He then focused on eight main

                                                      Swift for JavaScript Developers — Realm — a mobile database
                                                    • Androidの非同期処理を綺麗に書けるjdeferredが便利! - Qiita

                                                      ほとんどのAndroidアプリで書くことになる非同期処理。 非同期処理を順番に実行したい場合や並列に実行させたい事も当然あるわけだけど、これが普通に書くと結構読みにくい。 Androidアプリを作ってる人は同じような悩みを持ってるだろうと色々探してたらいい感じのやつ見つけた。 jdeferred 【GitHub】 似たようなやつだとこういうのもあるみたいだけど個人的にはjdeferredが好き android-promise【GitHub】 こういう感じだといいなーって思ってた要素 非同期処理をブロック化してコード上に書きたい 例) 非同期処理→3つの非同期を待ち合わせ→2つの非同期処理を待ち合わせ→非同期処理 こんな複雑な非同期処理しないと思うけど、こういう単位で書けるようにしたい 一つ目の非同期が終わった後にその結果を使って二つ目の非同期を実行する処理を簡潔に書ける 複数の非同期処理を

                                                        Androidの非同期処理を綺麗に書けるjdeferredが便利! - Qiita
                                                      • Promise.prototype.finally | blog.jxck.io

                                                        Intro Promise.prototype.finally の仕様が TC39 stage 3 となり、Safari TP37 で先行実装が入った。 tc39/proposal-promise-finally common task in async task よくあるユースケースとして、fetch() 中にスピナーを表示し、終わったら消すという場合。 スピナーは、fetch() が成功(resolve) しようと失敗(reject)しようと消したいため、これまでの Promise では両方のハンドラに処理が必要だった。 showSpinner() fetch() .then((response) => { hideSpinner() console.log(response) }) .catch((error) => { hideSpinner() console.log(error

                                                          Promise.prototype.finally | blog.jxck.io
                                                        • http://www.akadav.org/twistedhowto/async.html

                                                          • Babelのasync/await試してみた(+中の処理をちょっと追ってみた) - Qiita

                                                            Deleted articles cannot be recovered. Draft of this article would be also deleted. Are you sure you want to delete this article?

                                                              Babelのasync/await試してみた(+中の処理をちょっと追ってみた) - Qiita
                                                            • PromiseによるJavaScript非同期処理レシピ集

                                                              Promiseの概念はずいぶん浸透してきました。Promiseは単なる「新機能」のひとつから、もはや非同期処理における基本となりました。有志のライブラリなどもPromiseを返すのが当たり前になってきていて、コールバックでの処理はオプションであることが多くなりました。 さて、そうなってくるとPromiseの概念がどうこうというよりも、実用的なケースに対するコードスニペットがほしくなってきます。そこで今回の記事では、よくあるケースに対しての具体的解決策をいくつか提示します。 この記事について この記事では、JavaScript初心者に向けた、実用的な観点に焦点をあてて説明します。よっていつもの記事ほど正確性や厳密性はありません。 Promiseの「仕様」について詳しく知りたい場合は、MDNを読むなり、仕様書を読むなりしてください。 世界はPromiseに染まった Promise!Promis

                                                                PromiseによるJavaScript非同期処理レシピ集
                                                              • JSDeferred -> Promise 置き換え方法 | tech - 氾濫原

                                                                もはや Promise がスタンダードに入り、モダンな実行環境ではポリフィルすら必要なく使えるケースが増えましたね。 かくいう自分も JSDeferred は使っておらず完全に Promise 依存に切替えております。外部ライブラリ依存なんてないほうがいい!! JSDeferred と Promise の違い 機能的にはほぼ変わりがないので機械的に置き換えできますが、Promise は1度だけしか resolve できない点だけ違うので注意が必要。JSDeferred は値を保持しませんが、Promise は resolve した値を保持し、その後の then ではその値が返ってきます。 var resolver; var promise = new Promise(function (resolve, reject) { resolver = resolve; }); promise.t

                                                                • AbortSignal.any(), AbortSignal.timeout(), そして addEventListener() の Signal | blog.jxck.io

                                                                  Intro 最近 AbortSignal.any() が提案され、急速に実装が進んでいる。 すでに定義されている AbortSignal.timeout() や addEventListener() への Signal なども含め、非同期処理の中断を実装する際の API はかなり整備されてきた。 これら API のモチベーションと設計を中心にまとめる。 Abort 後のリソース解放 AbortSignal によって、非同期処理のキャンセルが可能になった。例として、Server 上での Fetch のタイムアウトの例を考えよう。 app.get("/entries", async (req, res) => { const perRequestController = new AbortController() const perRequestSignal = perRequestContr

                                                                    AbortSignal.any(), AbortSignal.timeout(), そして addEventListener() の Signal | blog.jxck.io
                                                                  • 非同期をわかりやすく制御しよう!ES6の「Promise」入門 | 株式会社LIG(リグ)|DX支援・システム開発・Web制作

                                                                    カメラを新調して写真撮りまくってます。CTOの林です。 ブラウザでの対応が進んできたこともあり、ES6がかなり注目されてきています。今日はその中でも「Promise」について簡単に解説していきたいと思います。 Promiseとは Promiseは、非同期の処理をわかりやすく制御するオブジェクトで、ES6(ES2015/ECMAScript 2015)に追加された機能の1つです。 http://caniuse.com/#feat=promises 現在は、多くのブラウザですでに実装されています。 また、多くのPolyfillが作られているため、非対応のIEでもPromiseを使うことができます。 https://github.com/jakearchibald/es6-promise https://github.com/taylorhakes/promise-polyfill https:

                                                                      非同期をわかりやすく制御しよう!ES6の「Promise」入門 | 株式会社LIG(リグ)|DX支援・システム開発・Web制作
                                                                    • Nodeへutil.promisify()の追加 - 技術探し

                                                                      add util.promisify()がそろそろ入りそう(承認の既定値越した) https://t.co/AdSMtzTgS6— hiroppy😶soliste (@about_hiroppy) 2017年4月27日 ということで久しぶりに記事を書くことにした。 4/24のNode学園でも少し話したが、自分がとても注目している追加です。 Node8への変更点を見たい方はスライド見てください。 abouthiroppy.github.io 本題 github.com github.com 簡単に話すと、今までコールバックだったのがこのutil.promisify()を使うことによりPromiseと同じように扱えるということ。 これだけでかなりすごい。今までコールバック内でresolveしていたのだからそこのPromise用の関数を作らなくてもよくなるのはとても楽だ。 child_proc

                                                                        Nodeへutil.promisify()の追加 - 技術探し
                                                                      • GitHub - stefanpenner/es6-promise: A polyfill for ES6-style Promises

                                                                        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 - stefanpenner/es6-promise: A polyfill for ES6-style Promises
                                                                        • Promises

                                                                          Motivation Consider the following synchronous JavaScript function to read a file and parse it as JSON. It is simple and easy to read, but you wouldn't want to use it in most applications as it is blocking. This means that while you are reading the file from disk (a slow operation) nothing else can happen. function readJSONSync(filename) { return JSON.parse(fs.readFileSync(filename, 'utf8')); } To

                                                                          • async/await、promise・・これが最後の「JavaScriptの非同期処理完全に理解した」 - Qiita

                                                                            福岡でVR・アプリ開発をやっている株式会社OneSmallStep代表取締役CTOの@_takeshi_24です。 最近フロントエンド界隈の技術の変化が活発です。 React、Angular、Vue.jsなどモダンなフロントエンド開発を始めた人も多くいると思います。 JavaScript開発でおそらく多くの人が最初につまづくであろう処理が非同期処理です。 私も最初はこの非同期処理にかなり戸惑いました。 そして今まで何度も「JavaScriptの非同期処理完全に理解した」と思っては、「あれ、この場合ってどうなるんだっけ?」 「結局わかってないじゃん・・・」の繰り返しでしたので、非同期処理についてきちんと整理しました。 そもそもJavaScriptはどのように動いているのか? JavaScriptはシングルスレッドで動く言語です。 シングルスレッドで動くということは、同時に2つ以上のことはでき

                                                                              async/await、promise・・これが最後の「JavaScriptの非同期処理完全に理解した」 - Qiita
                                                                            • コンストラクタの外からresolve/rejectを呼ぶPromsieテク

                                                                              Promsie を作って返す関数で、Promise コンストラクタの引数のコールバックではないところで resolve とか reject とかしたいことがある。 こんな感じで、外部に変数を作って普通に代入して外から resolve/reject を呼べるテクがある。 function registerSomething() { let resolve, reject; const promise = new Promise((res, rej) => { resolve = res; reject = rej; }); something.registerSomething((error, info) => { if (error) reject(error); resolve(info); }) return promise; } まあ実際には、上記コードくらいだったら普通にコンストラ

                                                                                コンストラクタの外からresolve/rejectを呼ぶPromsieテク
                                                                              • 【第8回】potatotipsでPromiseについて発表してきた

                                                                                【第8回】potatotips (iOS/Android開発Tips共有会) - connpass に 参加してきました。 自分はObjective-CでのPromiseと非同期処理について発表しました。 Xcode で gulp を使うお話 - saku2saku Xcode で gulp を使うお話 gulpを使った話 RettyはWebViewを使ったハイブリッドで利用 ターミナルから毎回コマンド打つのが面倒 Xcode で gulp を実行 ビルドフェーズに実行する 入れてない人に向けにちゃんと分岐するべき マルチバイトが上手くいかない ちゃんと環境変数の内容がターミナルと違う Account Manager and Sync Adapter - Shungho Arai Account Managerとは アプリのアカウントの総合窓口 一度Googleアカウントでログインすると共

                                                                                  【第8回】potatotipsでPromiseについて発表してきた
                                                                                • Promises/A+ (日本語訳)

                                                                                  Promises/A+ 日本語訳 このページ は、 Promises/A+ organization による Promises/A+ Promise Specification (バージョン 1.1.1, 2014-05-05)を日本語に翻訳したものです。 この翻訳の正確性は保証されません。 この仕様の公式な文書は英語版であり、この日本語版は公式のものではありません。 【 と 】で囲まれた部分は【訳者による注釈】です。 (他のウェブ関連仕様の一覧と共通機能の詳細) 更新:2015-01-14 (公開:2015-01-13 ) このページの大部分はスクリプトにより生成されています( 古いブラウザなど,一部のブラウザには対応していません: )。 本文ダブルクリックで当該箇所の原文が表示されます(左下隅に各種 表示切替ボタン — CSS や DOM の対応が古いブラウザでは、一部機能しないことが