lib/railway_ipc/rpc/server/server.rb in railway-ipc-2.0.2 vs lib/railway_ipc/rpc/server/server.rb in railway-ipc-2.0.3
- old
+ new
@@ -12,11 +12,11 @@
def self.respond_to(message_type, with:)
RailwayIpc::RPC::ServerResponseHandlers.instance.register(handler: with, message: message_type)
end
- def initialize(opts={ automatic_recovery: true }, rabbit_adapter: RailwayIpc::Rabbitmq::Adapter)
+ def initialize(_queue, _pool, opts={ automatic_recovery: true }, rabbit_adapter: RailwayIpc::Rabbitmq::Adapter)
@rabbit_connection = rabbit_adapter.new(
queue_name: self.class.queue_name,
exchange_name: self.class.exchange_name,
options: opts
)
@@ -27,9 +27,13 @@
.connect
.create_exchange
.create_queue(durable: true)
.bind_queue_to_exchange
subscribe_to_queue
+ end
+
+ def stop
+ rabbit_connection.disconnect
end
# rubocop:disable Metrics/AbcSize
# rubocop:disable Metrics/MethodLength
def work(payload)