Class: Harmoniser::Mock::Connection

Inherits:
Object
  • Object
show all
Defined in:
lib/harmoniser/mock/connection.rb

Instance Method Summary collapse

Constructor Details

#initialize(opts = {}, error_handler: nil, logger: nil) ⇒ Connection

Returns a new instance of Connection.



8
9
10
11
12
13
# File 'lib/harmoniser/mock/connection.rb', line 8

def initialize(opts = {}, error_handler: nil, logger: nil)
  @opts = opts
  @error_handler = error_handler
  @logger = logger
  @open = false
end

Instance Method Details

#closeObject



32
33
34
35
# File 'lib/harmoniser/mock/connection.rb', line 32

def close
  @open = false
  true
end

#create_channel(id = nil, consumer_pool_size = 1, consumer_pool_ack = false, consumer_pool_shutdown_timeout = 60) ⇒ Object



15
16
17
# File 'lib/harmoniser/mock/connection.rb', line 15

def create_channel(id = nil, consumer_pool_size = 1, consumer_pool_ack = false, consumer_pool_shutdown_timeout = 60)
  Channel.new
end

#open?Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/harmoniser/mock/connection.rb', line 19

def open?
  @open
end

#recovering_from_network_failure?Boolean

Returns:

  • (Boolean)


23
24
25
# File 'lib/harmoniser/mock/connection.rb', line 23

def recovering_from_network_failure?
  false
end

#startObject



27
28
29
30
# File 'lib/harmoniser/mock/connection.rb', line 27

def start
  @open = true
  self
end