read __SCRIPT__ def read(file) File.read(file) end file = "README" body = read(file) puts body Name Value file "README" Name Value file "README" body The File.read method takes care of returning the actual value once the thread resumes.
File.read(file) end d = "/Users" t1 = Thread.new do f = "#{d}/README" read(file) end t2 = Thread.new do f = "#{d}/.vimrc" read(file) end puts t1.value puts t2.value __SCRIPT__ t1 Name Value d "/Users"
Thread.new do f = "#{d}/README" read(file) end t2 = Thread.new do f = "#{d}/.vimrc" read(file) end puts t1.value puts t2.value __SCRIPT__ main t1 __SCRIPT__ t2
File.read(file) end d = "/Users" t1 = Thread.new do f = "#{d}/README" read(file) end t2 = Thread.new do f = "#{d}/.vimrc" read(file) end puts t1.value puts t2.value __SCRIPT__ t2 Name Value d "/Users"
Thread.new do f = "#{d}/README" read(file) end t2 = Thread.new do f = "#{d}/.vimrc" read(file) end puts t1.value puts t2.value __SCRIPT__ t2 Name Value d "/Users" def read(file) File.read(file) end d = "/Users" t1 = Thread.new do f = "#{d}/README" read(file) end t2 = Thread.new do f = "#{d}/.vimrc" read(file) end puts t1.value puts t2.value __SCRIPT__ t1 Name Value d "/Users" __SCRIPT__ def read(file) File.read(file) end d = "/Users" t1 = Thread.new do f = "#{d}/README" read(file) end t2 = Thread.new do f = "#{d}/.vimrc" read(file) end puts t1.value puts t2.value main Name Value d "/Users" active thread inactive threads
Thread.new do f = "#{d}/README" read(file) end t2 = Thread.new do f = "#{d}/.vimrc" read(file) end puts t1.value puts t2.value __SCRIPT__ main t1 __SCRIPT__ t2
end d = "/Users" t1 = Thread.new do f = "#{d}/README" read(file) end t2 = Thread.new do f = "#{d}/.vimrc" read(file) end puts t1.value puts t2.value main Name Value d "/Users"
= Thread.new do f = "#{d}/README" read(file) end t2 = Thread.new do f = "#{d}/.vimrc" read(file) end puts t1.value puts t2.value main Name Value d "/Users" active thread inactive threads def read(file) File.read(file) end d = "/Users" t1 = Thread.new do f = "#{d}/README" read(file) end t2 = Thread.new do f = "#{d}/.vimrc" read(file) end puts t1.value puts t2.value __SCRIPT__ t1 Name Value d "/Users" def read(file) File.read(file) end d = "/Users" t1 = Thread.new do f = "#{d}/README" read(file) end t2 = Thread.new do f = "#{d}/.vimrc" read(file) end puts t1.value puts t2.value __SCRIPT__ t2 Name Value d "/Users"
Thread.new do f = "#{d}/README" read(file) end t2 = Thread.new do f = "#{d}/.vimrc" read(file) end puts t1.value puts t2.value __SCRIPT__ t1 Name Value d "/Users" active thread inactive threads def read(file) File.read(file) end d = "/Users" t1 = Thread.new do f = "#{d}/README" read(file) end t2 = Thread.new do f = "#{d}/.vimrc" read(file) end puts t1.value puts t2.value __SCRIPT__ t2 Name Value d "/Users" __SCRIPT__ def read(file) File.read(file) end d = "/Users" t1 = Thread.new do f = "#{d}/README" read(file) end t2 = Thread.new do f = "#{d}/.vimrc" read(file) end puts t1.value puts t2.value main Name Value d "/Users"
Thread.new do f = "#{d}/README" read(file) end t2 = Thread.new do f = "#{d}/.vimrc" read(file) end puts t1.value puts t2.value __SCRIPT__ main t1 __SCRIPT__ t2
Thread.new do f = "#{d}/README" read(file) end t2 = Thread.new do f = "#{d}/.vimrc" read(file) end puts t1.value puts t2.value __SCRIPT__ main t1 __SCRIPT__ t2
Thread.new do f = "#{d}/README" read(file) end t2 = Thread.new do f = "#{d}/.vimrc" read(file) end puts t1.value puts t2.value read __SCRIPT__ main t1 __SCRIPT__ t2
def read(file) File.read(file) end d = "/Users" t1 = Thread.new do f = "#{d}/README" read(file) end t2 = Thread.new do f = "#{d}/.vimrc" read(file) end puts t1.value puts t2.value read __SCRIPT__ t1 Name Value d "/Users" Name Value file "/Users/ README"
= "/Users" t1 = Thread.new do f = "#{d}/README" read(file) end t2 = Thread.new do f = "#{d}/.vimrc" read(file) end puts t1.value puts t2.value __SCRIPT__ t2 Name Value d "/Users" __SCRIPT__ def read(file) File.read(file) end d = "/Users" t1 = Thread.new do f = "#{d}/README" read(file) end t2 = Thread.new do f = "#{d}/.vimrc" read(file) end puts t1.value puts t2.value main Name Value d "/Users" def read(file) File.read(file) end d = "/Users" t1 = Thread.new do f = "#{d}/README" read(file) end t2 = Thread.new do f = "#{d}/.vimrc" read(file) end puts t1.value puts t2.value read __SCRIPT__ t1 Name Value d "/Users" Name Value file "/Users/ README"
Thread.new do f = "#{d}/README" read(file) end t2 = Thread.new do f = "#{d}/.vimrc" read(file) end puts t1.value puts t2.value read __SCRIPT__ main t1 __SCRIPT__ t2
Thread.new do f = "#{d}/README" read(file) end t2 = Thread.new do f = "#{d}/.vimrc" read(file) end puts t1.value puts t2.value read __SCRIPT__ main t1 __SCRIPT__ t2
Thread.new do f = "#{d}/README" read(file) end t2 = Thread.new do f = "#{d}/.vimrc" read(file) end puts t1.value puts t2.value read __SCRIPT__ main t1 read __SCRIPT__ t2
def read(file) File.read(file) end d = "/Users" t1 = Thread.new do f = "#{d}/README" read(file) end t2 = Thread.new do f = "#{d}/.vimrc" read(file) end puts t1.value puts t2.value body __SCRIPT__ t2 Name Value d "/Users" Name Value file "/Users/ README"
"/Users" t1 = Thread.new do f = "#{d}/README" read(file) end t2 = Thread.new do f = "#{d}/.vimrc" read(file) end puts t1.value puts t2.value main Name Value d "/Users" def read(file) File.read(file) end d = "/Users" t1 = Thread.new do f = "#{d}/README" read(file) end t2 = Thread.new do f = "#{d}/.vimrc" read(file) end puts t1.value puts t2.value body __SCRIPT__ t2 Name Value d "/Users" Name Value file "/Users/ README" def read(file) File.read(file) end d = "/Users" t1 = Thread.new do f = "#{d}/README" read(file) end t2 = Thread.new do f = "#{d}/.vimrc" read(file) end puts t1.value puts t2.value read __SCRIPT__ t1 Name Value d "/Users" Name Value file "/Users/ README" waiting for IO to be ready waiting for t1 to finish waiting for IO to be ready
here because I think the “tightly integrated/loosely coupled” buzz phrase is actually detrimental to understanding how the trade-off’s work. And there are trade-offs and those trade-offs mean that there isn’t and will never be one perfect web-framework which somehow magically isn’t subject to the down-side of any of the constraints and design trade-offs that we all have to deal with every day.
chain. Single systems shove it all into one place. Isolating concerns moves it to the links between the concerns. Too many isolated concerns at the same level of abstraction reintroduce complexity.