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
Posted 17 August 2015 - hold onto your butts for this one, it's spec-heavy When I told my colleague Matt Gaunt I was thinking of writing a piece on microtask queueing and execution within the browser's event loop, he said "I'll be honest with you Jake, I'm not going to read that". Well, I've written it anyway, so we're all going to sit here and enjoy it, ok? Actually, if video's more your thing, P
Promise Cancellation Is Dead — Long Live Promise Cancellation! Not very long ago Domenic Denicola (worth a follow, a very smart guy) withdrew his proposal for promise cancellation from the TC39. A lot of people might think that means that promise cancellation isn’t coming to JavaScript. Those people would be right, if you couldn’t already cancel a promise via very similar means to what was propose
ECMAScript 2015 で導入された Promise の関数 all と race だけで表現できる非同期処理の待ち合わせについての考察です。 考察の対象とした待ち合わせの条件は、「過半数の Promise が解決されるまで待つ」をはじめとした特殊なものです。結論からいうと、all と race だけを組み合わせて、多数決による待ち合わせを表現可能です。ただし、与えられた Promise の解決順序に依存する待ち合わせは、all と race だけでは書けません(ただし証明はできてないです 追記2020/11/08 書けるようです(否定的に証明されました)。 制約条件 Promise#then を使えば、なんでもできてしまいます。 そのため、この後の議論では Promise#then は封印します。 待ち合わせの書き方 まず、待ち合わせの表現方法を導入します。 非同期に解決される
You're Missing the Point of Promises · GitHubを読んだ。 特に興味深かったのが"That Second Paragraph"の見出しで始まるセクション。曰く、Promisesとは、非同期ルーチンとその結果を受ける処理における以下の「4つのシナリオ」を表現できるようにするものらしい。 非同期ルーチンが正常に終了し、その結果も正常である。 (fulfilled and accepted) 非同期ルーチンが正常に終了したが、その結果が異常なので例外を投げる。 (fufilled but rejected) 非同期ルーチンが例外を投げたが、その例外をキャッチして適切に処理する。 (rejected but handled) 非同期ルーチンが例外を投げ、その例外をキャッチするも、処理できずにrethrowする。 (rejected and rethrown
NAME Promises - An implementation of Promises in Perl VERSION version 1.04 SYNOPSIS use AnyEvent::HTTP; use JSON::XS qw[ decode_json ]; use Promises qw[ collect deferred ]; sub fetch_it { my ($uri) = @_; my $d = deferred; http_get $uri => sub { my ($body, $headers) = @_; $headers->{Status} == 200 ? $d->resolve( decode_json( $body ) ) : $d->reject( $body ) }; $d->promise; } my $cv = AnyEvent->condv
C++11標準ライブラリで新しく追加されたstd::promiseとstd::futureについてメモ。 future/promiseの基本 両者ともに標準ヘッダ <future> にて定義されるクラステンプレートであり、「別スレッドでの処理完了を待ち、その処理結果を取得する」といった非同期処理を実現するための部品*1。 処理結果として、通常の戻り値(value)または例外(exception)を扱う*2。戻り値の型はテンプレート引数にて指定するが、例外は任意の型を扱うことができる。(例: int型を扱うならstd::future<int>, std::promise<int>を用いる。例外はstd::exception_ptrを利用するため任意の型を伝搬可能。) future は計算処理の完了待ち(同期機構)と結果取り出し(通信チャネル)機能を提供する。 promise は計算処理の結果
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く