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 about bidirectional Unicode characters
08:58 Defi_: can anyone tell me if there are any obvious disadvantages to patching a blocking library to use fibers at the socket level? | |
08:58 Defi_: its far too much effort to have to rewrite large chunks of every library just to make it async and fiber-aware | |
08:59 raggi: if it uses non-stack stored state you could end up with concurrency issues (read: race conditions) | |
08:59 raggi: fibers as implemented in MRI have limited size stacks (4kb) | |
09:00 Defi_: hmm alright :/ | |
09:01 raggi: if the library is trying to be thread safe, it can make a real mess too | |
09:01 raggi: Defi_: just use threads. | |
09:02 Defi_: raggi: not gonna happen... | |
09:02 Defi_: even if this was a personal project, i wouldnt use threads | |
09:03 Defi_: guess ill just have to continue rewriting parts of a bunch of libs as i go |
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 about bidirectional Unicode characters
gemmirror/code/a/autobundle-1.0.0.pre1/lib/rubygems_plugin.rb | |
gemmirror/code/a/autobundle-1.0.0.pre2/lib/rubygems_plugin.rb | |
gemmirror/code/a/authoxy-1.2.1/lib/rubygems_plugin.rb | |
gemmirror/code/s/specific_install-0.2.2/lib/rubygems_plugin.rb | |
gemmirror/code/s/specific_install-0.2.1/lib/rubygems_plugin.rb | |
gemmirror/code/s/specific_install-0.2.3/lib/rubygems_plugin.rb | |
gemmirror/code/s/show_gem-0.0.1/lib/rubygems_plugin.rb | |
gemmirror/code/s/show_gem-0.0.2/lib/rubygems_plugin.rb | |
gemmirror/code/s/shway-3.0.1/lib/rubygems_plugin.rb | |
gemmirror/code/s/shway-3.0/lib/rubygems_plugin.rb |
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 about bidirectional Unicode characters
gc_mark_children() | |
{ | |
cthulhu: | |
fthagn() | |
fthagn!() | |
goto cthulhu; | |
} |
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 about bidirectional Unicode characters
require 'rubygems' | |
globs = Gem.path.map { |path| File.join(path, 'specifications', '*.gemspec') } | |
updated = 0 | |
Dir["{#{globs.join(',')}}"].each do |f| | |
spec = Gem::Specification.load(f) | |
open(f, 'w') do |io| | |
io.write spec.to_ruby_for_cache | |
end |
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 about bidirectional Unicode characters
RAW = true # flip me to make the logs readable, for interests sake. | |
def write_strings_to fn | |
open(fn, 'w+') do |f| | |
ObjectSpace.each_object do |o| | |
f.send((RAW ? :print : :puts), o) if o.class == String | |
end | |
end | |
end |
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 about bidirectional Unicode characters
#!/usr/bin/env ruby | |
gc = ARGV.shift if ARGV.first == "-gc" | |
Dir.chdir ARGV.first || File.expand_path(File.dirname(__FILE__)) | |
io = IO.popen('exec ssh -MNqv git@github.com 2>&1') | |
waited = 0 | |
until io.readline =~ /Entering interactive session/ | |
sleep 0.01 |
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 about bidirectional Unicode characters
class DiskWriter < EM::Connection | |
# A random stab in the dark at somethign that's loosely efficient. Assuming | |
# you have a larger page size than 4kb, you'll probably still want ruby to | |
# write a ton of pages at a time to anything resembling a spindle. On most | |
# systems, this will default to 64kb. It's possible you may get better | |
# performance going much higher. If you end up GC bound, or other operations | |
# are causing leak like behavior, then you may find higher tunings become | |
# less efficient in production over time. It is also worth noting that some | |
# versions ::Queue do not free their buffer pages. | |
DEFAULT_THRESHOLD = 16384 * `getconf PAGESIZE`.to_i |
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 about bidirectional Unicode characters
class Chef::Provider::Service::Launchd < Chef::Provider::Service::Simple | |
LAUNCHCTL_FORMAT = /([\d-]+)\s+([\d-]+)\s+([[:print:]]+)/ | |
def initialize(new_resource, run_context) | |
raise ArgumentError, "run_context cannot be nil" unless run_context | |
super | |
run_context.node | |
end |
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 about bidirectional Unicode characters
module RaggiGrowl | |
def self.growl title, msg, img = 'alert.png' , pri=0, stick="" | |
system "growlnotify -n autotest --image #{img} -p #{pri} -m #{msg.inspect} #{title} #{stick}" | |
false | |
end | |
def self.dir; Dir.pwd; end | |
def self.good; "~/Library/autotest/god.png"; end | |
def self.bad; "~/Library/autotest/dead.png"; end | |
SpecResults = /(\d+)\s+examples?,\s*(\d+)\s+failures?(,\s*(\d+)\s+pending)?/m |
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 about bidirectional Unicode characters
require 'fusefs' | |
require 'net/http/persistent' | |
require 'dbm' | |
class Gem::Fuse | |
VERSION = '1.0.0' | |
SPECZ = "specs.#{Gem.marshal_version}.gz" | |
SPECZPATH = '/' + SPECZ | |
RUBY = 'ruby' | |
REJECT = %r{^/mach_kernel$|^/Backups.backupdb$} |