Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist
View fails.rb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160
require 'celluloid'
require 'open-uri'
 
class Fetcher
include Celluloid
 
def fetch(url)
URI.parse(url).read
end
end
 
f = Fetcher.new
=> #<Celluloid::Actor(Fetcher:0x15ac)>
f.fetch("http://google.com")
 
=> # SystemStackError: SystemStackError
from kernel/common/string.rb:1050:in `modify!'
from kernel/common/string19.rb:418:in `<<'
from kernel/common/regexp.rb:111:in `<<'
from kernel/common/regexp.rb:277:in `push_current_character!'
from kernel/common/regexp.rb:271:in `process_until_group_finished'
from kernel/common/regexp.rb:272:in `process_until_group_finished'
from kernel/common/regexp.rb:272:in `process_until_group_finished'
from kernel/common/regexp.rb:272:in `process_until_group_finished'
from kernel/common/regexp.rb:272:in `process_until_group_finished'
from kernel/common/regexp.rb:272:in `process_until_group_finished'
from kernel/common/regexp.rb:272:in `process_until_group_finished'
from kernel/common/regexp.rb:272:in `process_until_group_finished'
from kernel/common/regexp.rb:272:in `process_until_group_finished'
from kernel/common/regexp.rb:272:in `process_until_group_finished'
from kernel/common/regexp.rb:272:in `process_until_group_finished'
from kernel/common/regexp.rb:272:in `process_until_group_finished'
E, [2012-11-12T20:39:26.921212 #48555] ERROR -- : Fetcher crashed!
SystemStackError: SystemStackError
kernel/common/string.rb:1050:in `modify!'
kernel/common/string19.rb:418:in `<<'
kernel/common/regexp.rb:111:in `<<'
kernel/common/regexp.rb:277:in `push_current_character!'
kernel/common/regexp.rb:271:in `process_until_group_finished'
kernel/common/regexp.rb:272:in `process_until_group_finished'
kernel/common/regexp.rb:272:in `process_until_group_finished'
kernel/common/regexp.rb:272:in `process_until_group_finished'
kernel/common/regexp.rb:272:in `process_until_group_finished'
kernel/common/regexp.rb:272:in `process_until_group_finished'
kernel/common/regexp.rb:272:in `process_until_group_finished'
kernel/common/regexp.rb:272:in `process_until_group_finished'
kernel/common/regexp.rb:272:in `process_until_group_finished'
kernel/common/regexp.rb:272:in `process_until_group_finished'
kernel/common/regexp.rb:272:in `process_until_group_finished'
kernel/common/regexp.rb:272:in `process_until... 78 levels...
_group_finished'
kernel/common/regexp.rb:272:in `process_until_group_finished'
kernel/common/regexp.rb:272:in `process_until_group_finished'
kernel/common/regexp.rb:272:in `process_until_group_finished'
kernel/common/regexp.rb:272:in `process_until_group_finished'
kernel/common/regexp.rb:221:in `process_group'
kernel/common/regexp.rb:201:in `create_parts'
kernel/common/regexp.rb:208:in `create_parts'
kernel/common/regexp.rb:208:in `create_parts'
kernel/common/regexp.rb:208:in `create_parts'
kernel/common/regexp.rb:208:in `create_parts'
kernel/common/regexp.rb:208:in `create_parts'
kernel/common/regexp.rb:208:in `create_parts'
kernel/common/regexp.rb:208:in `create_parts'
kernel/common/regexp.rb:208:in `create_parts'
kernel/common/regexp.rb:208:in `create_parts'
kernel/common/regexp.rb:208:in `create_parts'
kernel/common/regexp.rb:208:in `create_parts'
kernel/common/regexp.rb:208:in `create_parts'
kernel/common/regexp.rb:208:in `create_parts'
kernel/common/regexp.rb:208:in `create_parts'
kernel/common/regexp.rb:208:in `create_parts'
kernel/common/regexp.rb:208:in `create_parts'
kernel/common/regexp.rb:208:in `create_parts'
kernel/common/regexp.rb:208:in `create_parts'
kernel/common/regexp.rb:208:in `create_parts'
kernel/common/regexp.rb:208:in `create_parts'
kernel/common/regexp.rb:208:in `create_parts'
kernel/common/regexp.rb:208:in `create_parts'
kernel/common/regexp.rb:208:in `create_parts'
kernel/common/regexp.rb:208:in `create_parts'
kernel/common/regexp.rb:208:in `create_parts'
kernel/common/regexp.rb:208:in `create_parts'
kernel/common/regexp.rb:208:in `create_parts'
kernel/common/regexp.rb:208:in `create_parts'
kernel/common/regexp.rb:208:in `create_parts'
kernel/common/regexp.rb:208:in `create_parts'
kernel/common/regexp.rb:208:in `create_parts'
kernel/common/regexp.rb:208:in `create_parts'
kernel/common/regexp.rb:208:in `create_parts'
kernel/common/regexp.rb:208:in `create_parts'
kernel/common/regexp.rb:208:in `create_parts'
kernel/common/regexp.rb:208:in `create_parts'
kernel/common/regexp.rb:208:in `create_parts'
kernel/common/regexp.rb:208:in `create_parts'
kernel/common/regexp.rb:208:in `create_parts'
kernel/common/regexp.rb:208:in `create_parts'
kernel/common/regexp.rb:208:in `create_parts'
kernel/common/regexp.rb:208:in `create_parts'
kernel/common/regexp.rb:208:in `create_parts'
kernel/common/regexp.rb:208:in `create_parts'
kernel/common/regexp.rb:208:in `create_parts'
kernel/common/regexp.rb:208:in `create_parts'
kernel/common/regexp.rb:208:in `create_parts'
kernel/common/regexp.rb:208:in `create_parts'
kernel/common/regexp.rb:208:in `create_parts'
kernel/common/regexp.rb:208:in `create_parts'
kernel/common/regexp.rb:208:in `create_parts'
kernel/common/regexp.rb:208:in `create_parts'
kernel/common/regexp.rb:208:in `create_parts'
kernel/common/regexp.rb:208:in `create_parts'
kernel/common/regexp.rb:208:in `create_parts'
kernel/common/regexp.rb:208:in `create_parts'
kernel/common/regexp.rb:208:in `create_parts'
kernel/com from kernel/common/hash19.rb:243:in `each'
from /Users/bmckim/.rbenv/versions/rbx-2.0.0-dev/lib/19/net/http.rb:1518:in `each (each_header)'
from /Users/bmckim/.rbenv/versions/rbx-2.0.0-dev/lib/19/open-uri.rb:332:in `open_http'
from /Users/bmckim/.rbenv/versions/rbx-2.0.0-dev/lib/19/open-uri.rb:775:in `buffer_open'
from /Users/bmckim/.rbenv/versions/rbx-2.0.0-dev/lib/19/open-uri.rb:203:in `open_loop'
from kernel/common/throw_catch19.rb:8:in `catch'
from kernel/common/throw_catch.rb:10:in `register'
from kernel/common/throw_catch19.rb:7:in `catch'
from /Users/bmckim/.rbenv/versions/rbx-2.0.0-dev/lib/19/open-uri.rb:201:in `open_loop'
from /Users/bmckim/.rbenv/versions/rbx-2.0.0-dev/lib/19/open-uri.rb:146:in `open_uri'
from /Users/bmckim/.rbenv/versions/rbx-2.0.0-dev/lib/19/open-uri.rb:677:in `open'
from /Users/bmckim/.rbenv/versions/rbx-2.0.0-dev/lib/19/open-uri.rb:685:in `read'
from (irb):8:in `fetch'
from /Users/bmckim/.rbenv/versions/rbx-2.0.0-dev/gems/1.9/gems/celluloid-0.12.3/lib/celluloid/calls.rb:57:in `dispatch'
from /Users/bmckim/.rbenv/versions/rbx-2.0.0-dev/gems/1.9/gems/celluloid-0.12.3/lib/celluloid/actor.rb:323:in `handle_message'
from /Users/bmckim/.rbenv/versions/rbx-2.0.0-dev/gems/1.9/gems/celluloid-0.12.3/lib/celluloid/tasks/task_fiber.rb:22:in `initialize'mon/regexp.rb:208:in `create_parts'
kernel/common/regexp.rb:208:in `create_parts'
kernel/common/regexp.rb:208:in `create_parts'
kernel/common/regexp.rb:208:in `create_parts'
kernel/common/regexp.rb:208:in `create_parts'
kernel/common/regexp.rb:187:in `parts'
kernel/common/regexp.rb:298:in `options_string'
kernel/common/regexp.rb:174:in `string'
kernel/common/regexp.rb:316:in `to_s'
/Users/bmckim/.rbenv/versions/rbx-2.0.0-dev/lib/19/open-uri.rb:463:in `content_type_parse'
/Users/bmckim/.rbenv/versions/rbx-2.0.0-dev/lib/19/open-uri.rb:498:in `charset'
/Users/bmckim/.rbenv/versions/rbx-2.0.0-dev/lib/19/open-uri.rb:422:in `meta_setup_encoding'
/Users/bmckim/.rbenv/versions/rbx-2.0.0-dev/lib/19/open-uri.rb:443:in `meta_add_field'
/Users/bmckim/.rbenv/versions/rbx-2.0.0-dev/lib/19/open-uri.rb:332:in `open_http'
/Users/bmckim/.rbenv/versions/rbx-2.0.0-dev/lib/19/net/http.rb:1519:in `each_header'
kernel/common/hash19.rb:243:in `each'
/Users/bmckim/.rbenv/versions/rbx-2.0.0-dev/lib/19/net/http.rb:1518:in `each (each_header)'
/Users/bmckim/.rbenv/versions/rbx-2.0.0-dev/lib/19/open-uri.rb:332:in `open_http'
/Users/bmckim/.rbenv/versions/rbx-2.0.0-dev/lib/19/open-uri.rb:775:in `buffer_open'
/Users/bmckim/.rbenv/versions/rbx-2.0.0-dev/lib/19/open-uri.rb:203:in `open_loop'
kernel/common/throw_catch19.rb:8:in `catch'
kernel/common/throw_catch.rb:10:in `register'
kernel/common/throw_catch19.rb:7:in `catch'
/Users/bmckim/.rbenv/versions/rbx-2.0.0-dev/lib/19/open-uri.rb:201:in `open_loop'
/Users/bmckim/.rbenv/versions/rbx-2.0.0-dev/lib/19/open-uri.rb:146:in `open_uri'
/Users/bmckim/.rbenv/versions/rbx-2.0.0-dev/lib/19/open-uri.rb:677:in `open'
/Users/bmckim/.rbenv/versions/rbx-2.0.0-dev/lib/19/open-uri.rb:685:in `read'
(irb):8:in `fetch'
/Users/bmckim/.rbenv/versions/rbx-2.0.0-dev/gems/1.9/gems/celluloid-0.12.3/lib/celluloid/calls.rb:57:in `dispatch'
/Users/bmckim/.rbenv/versions/rbx-2.0.0-dev/gems/1.9/gems/celluloid-0.12.3/lib/celluloid/actor.rb:323:in `handle_message'
/Users/bmckim/.rbenv/versions/rbx-2.0.0-dev/gems/1.9/gems/celluloid-0.12.3/lib/celluloid/tasks/task_fiber.rb:22:in `initialize'
View fails.rb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
require 'celluloid'
require 'open-uri'
 
URI.parse("http://google.com").read
=> # the body of google.com
 
class Fetcher
include Celluloid
 
def fetch(url)
URI.parse(url).read
end
end
 
f = Fetcher.new
=> #<Celluloid::Actor(Fetcher:0x2660)>
f.fetch("http://google.com")
=> # the body of google.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.