Created
April 14, 2017 18:03
-
-
Save neektza/c2744495dfd9d696a574a42864c82338 to your computer and use it in GitHub Desktop.
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 EventMachine | |
def self.defer op = nil, callback = nil, &blk | |
unless @threadpool | |
@threadpool = [] | |
@threadqueue = ::Queue.new | |
@resultqueue = ::Queue.new | |
spawn_threadpool | |
end | |
@threadqueue << [op||blk,callback] | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment