Give same name to common example
This commit is contained in:
parent
760c008311
commit
35ef98f4d0
4 changed files with 0 additions and 0 deletions
45
Examples/ruby/exceptproxy/runme.rb
Normal file
45
Examples/ruby/exceptproxy/runme.rb
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
require 'example'
|
||||
|
||||
q = Example::IntQueue.new(10)
|
||||
|
||||
puts "Inserting items into intQueue"
|
||||
|
||||
begin
|
||||
0.upto(100) do |i|
|
||||
q.enqueue(i)
|
||||
end
|
||||
rescue Example::FullError => e
|
||||
puts "Maxsize is: #{e.maxsize}"
|
||||
end
|
||||
|
||||
puts "Removing items"
|
||||
|
||||
begin
|
||||
loop do
|
||||
q.dequeue()
|
||||
end
|
||||
rescue Example::EmptyError => e
|
||||
## do nothing
|
||||
end
|
||||
|
||||
q = Example::DoubleQueue.new(1000)
|
||||
|
||||
puts "Inserting items into doubleQueue"
|
||||
|
||||
begin
|
||||
0.upto(100) do |i|
|
||||
q.enqueue(i*1.5)
|
||||
end
|
||||
rescue Example::FullError => e
|
||||
puts "Maxsize is: #{e.maxsize}"
|
||||
end
|
||||
|
||||
puts "Removing items"
|
||||
|
||||
begin
|
||||
loop do
|
||||
q.dequeue()
|
||||
end
|
||||
rescue Example::EmptyError => e
|
||||
# do nothing
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue