nats_messaging 1.2.8 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2d87203d37b1e6d38e56cfbc33115ea9138d5d01e40674f2c034f6bbfbaa4df2
4
- data.tar.gz: 1aa73a94a81abad33c4cd3fb726c21bfbe82d222b640aabdf82b2aa8c96096eb
3
+ metadata.gz: 85ff48cb51b0c9bfc615d5c2f8e9a555a64ff08d264e7273d27f521b94b4c4da
4
+ data.tar.gz: 4162a4cbfd74d39ec9af5a4f4a5cbf5e80e3635439be570f5263f44adba633cb
5
5
  SHA512:
6
- metadata.gz: f66d3a80f97030d6232802e6024fd2d27313dbf2ff128222bf4b63f53f58fb2b0f81427811f7b25ef328450d82fa8e2afef5f8977c2fb12776da6090cd0676dc
7
- data.tar.gz: e2ad71e5fc0d5d675ea5af51e579e7f1946dcd197fe51aec96310c7af57737c6dd4257cb8bb33a8eb62e6b61f29654efaf2070c99e9020e9f063c7dcb8262079
6
+ metadata.gz: 2452efb96a79d7eaba51826b634b3a8917b00a1a4f7942c150b5f538a34108f60735e8e3df31bfca5b2b473c24917cfa017e36353fc42fab33795212d0959e5b
7
+ data.tar.gz: 28358eb8aad977fdb708061be7b1090d39ef097f52ede12bf2b0018feb18c95e40dc7a0666089f84e1bb9a9a372f3988e2ee17e783b5072c878b201fa40f9c54
@@ -103,7 +103,6 @@ module NatsMessaging
103
103
  if @subscriptions[subject]
104
104
  @subscriptions[subject].unsubscribe
105
105
  end
106
- unpacked_data = nil
107
106
  begin
108
107
  # Create a new subscription
109
108
  puts "NATS: Listening on #{subject} with reply message: #{reply_message}"
@@ -112,12 +111,12 @@ module NatsMessaging
112
111
  unpacked_data = MessagePack.unpack(msg.data) # Deserializar mensaje recibido
113
112
  puts "NATS: Received request on #{subject}: #{unpacked_data}"
114
113
  yield_return = yield(subject, unpacked_data) if block_given?
115
- reply_message = yield_return if reply_message.nil?
116
- packed_reply = reply_message.to_msgpack # Serializar respuesta
114
+ reply = reply_message.nil? ? yield_return : reply_message
115
+ packed_reply = reply.to_msgpack # Serializar respuesta
117
116
  # Asegurar que msg.reply existe antes de responder
118
117
  if msg.reply
119
118
  @nats.publish(msg.reply, packed_reply)
120
- puts "NATS: Replied to #{subject} with message: #{reply_message}"
119
+ puts "NATS: Replied to #{subject} with message: #{reply}"
121
120
  else
122
121
  puts "NATS: No reply subject for #{subject}, cannot respond"
123
122
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nats_messaging
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.8
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bea Graboloza
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-04-17 00:00:00.000000000 Z
11
+ date: 2025-04-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nats-pure