Skip to content

Commit

Permalink
Use array for passing param
Browse files Browse the repository at this point in the history
  • Loading branch information
descholar-ceo committed Feb 12, 2024
1 parent e426ed3 commit ce75d40
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/gato/runner.cr
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
module Gato
class Runner
def self.start(arg0 : NamedTuple(queue_name: String, block: JSON::Any ->)) : Nil
def self.start(param : Array(NamedTuple(queue_name: String, block: JSON::Any ->))) : Nil
Log.notice { "El gato esta maullando..." }

AMQP::Client.start(Gato.configuration.amqp_url.to_s) do |c|
c.channel do |ch|
q = ch.queue arg0[:queue_name]
q = ch.queue param[0][:queue_name]
ch.prefetch count: 1

q.subscribe(no_ack: false, block: true) do |msg|
message = JSON.parse msg.body_io.to_s
Log.notice { "Received a new Message" }

arg0[:block].call message
param[0][:block].call message

Log.notice { "Done" }
end
Expand Down

0 comments on commit ce75d40

Please sign in to comment.