def new_brb_out_request(meth, *args, &blck)
Thread.current[:brb_nb_out] ||= 0
Thread.current[:brb_nb_out] += 1
raise BrBCallbackWithBlockingMethodException.new if is_brb_request_blocking?(meth) and block_given?
block = (is_brb_request_blocking?(meth) or block_given?) ? Thread.current.to_s.to_sym : nil
if block
args << block
args << Thread.current[:brb_nb_out]
end
if block_given?
meth = "#{meth}_block".to_sym
end
args.size > 0 ? brb_send([MessageRequestCode, meth, args]) : brb_send([MessageRequestCode, meth])
if block_given?
declare_callback(block, Thread.current[:brb_nb_out], &blck)
elsif block
begin
r = recv(block, Thread.current[:brb_nb_out], &blck)
rescue Exception => e
raise e
ensure
end
if r.kind_of? Exception
raise r
end
return r
end
nil
end