{"provider_url":"https://hatena.blog","type":"rich","categories":[],"width":"100%","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Feswai.hatenablog.com%2Fentry%2F2016%2F04%2F10%2F063806\" title=\"Future\u30d1\u30bf\u30fc\u30f32 - weblog.sy\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","blog_url":"https://eswai.hatenablog.com/","version":"1.0","title":"Future\u30d1\u30bf\u30fc\u30f32","author_url":"https://blog.hatena.ne.jp/eswai/","provider_name":"Hatena Blog","published":"2016-04-10 06:38:06","description":"concurrent-ruby\u3092\u3064\u304b\u3046\u3068future\u30d1\u30bf\u30fc\u30f3\u304c\u3001\u304b\u306a\u308a\u304d\u308c\u3044\u306b\u66f8\u3051\u308b\u3002 github.com require 'concurrent-edge' Concurrent.future { raise \"exception\" if [true, false].sample true }.then {|m| puts \"succeed #{m}\" # \u6210\u529f\u3057\u305f\u6642\u306e\u51e6\u7406\u3001view\u306b\u306a\u3052\u305f\u308a }.rescue{|m| puts \"failed #{m}\" # \u5931\u6557\u3057\u305f\u6642\u306e\u51e6\u7406 }.then{|m| puts \"finished\" # finalize } sleep 0.1","image_url":null,"blog_title":"weblog.sy","url":"https://eswai.hatenablog.com/entry/2016/04/10/063806","height":"190","author_name":"eswai"}