bunny 2.23.0 → 3.0.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 +4 -4
- data/README.md +38 -36
- data/lib/amq/protocol/extensions.rb +2 -0
- data/lib/bunny/authentication/credentials_encoder.rb +2 -0
- data/lib/bunny/authentication/external_mechanism_encoder.rb +2 -0
- data/lib/bunny/authentication/plain_mechanism_encoder.rb +2 -0
- data/lib/bunny/channel.rb +778 -150
- data/lib/bunny/channel_id_allocator.rb +2 -0
- data/lib/bunny/concurrent/atomic_fixnum.rb +2 -0
- data/lib/bunny/concurrent/condition.rb +2 -0
- data/lib/bunny/concurrent/continuation_queue.rb +2 -0
- data/lib/bunny/concurrent/exception_accumulator.rb +115 -0
- data/lib/bunny/concurrent/synchronized_sorted_set.rb +2 -0
- data/lib/bunny/consumer.rb +4 -11
- data/lib/bunny/consumer_tag_generator.rb +2 -0
- data/lib/bunny/consumer_work_pool.rb +2 -0
- data/lib/bunny/cruby/socket.rb +36 -2
- data/lib/bunny/cruby/ssl_socket.rb +44 -1
- data/lib/bunny/delivery_info.rb +23 -15
- data/lib/bunny/exceptions.rb +33 -2
- data/lib/bunny/exchange.rb +27 -13
- data/lib/bunny/framing.rb +2 -0
- data/lib/bunny/get_response.rb +20 -14
- data/lib/bunny/heartbeat_sender.rb +4 -2
- data/lib/bunny/message_properties.rb +2 -0
- data/lib/bunny/queue.rb +31 -39
- data/lib/bunny/reader_loop.rb +9 -7
- data/lib/bunny/return_info.rb +18 -11
- data/lib/bunny/session.rb +387 -63
- data/lib/bunny/socket.rb +7 -12
- data/lib/bunny/ssl_socket.rb +7 -12
- data/lib/bunny/test_kit.rb +1 -0
- data/lib/bunny/timeout.rb +2 -0
- data/lib/bunny/timestamp.rb +3 -1
- data/lib/bunny/topology_recovery_filter.rb +71 -0
- data/lib/bunny/topology_registry.rb +824 -0
- data/lib/bunny/transport.rb +54 -49
- data/lib/bunny/version.rb +2 -1
- data/lib/bunny.rb +2 -1
- metadata +25 -14
- data/lib/bunny/concurrent/linked_continuation_queue.rb +0 -61
- data/lib/bunny/jruby/socket.rb +0 -57
- data/lib/bunny/jruby/ssl_socket.rb +0 -58
- data/lib/bunny/versioned_delivery_tag.rb +0 -28
data/lib/bunny/ssl_socket.rb
CHANGED
|
@@ -1,14 +1,9 @@
|
|
|
1
|
-
#
|
|
2
|
-
if defined?(JRUBY_VERSION)
|
|
3
|
-
require "bunny/jruby/ssl_socket"
|
|
1
|
+
# frozen_string_literal: true
|
|
4
2
|
|
|
5
|
-
|
|
6
|
-
SSLSocketImpl = JRuby::SSLSocket
|
|
7
|
-
end
|
|
8
|
-
else
|
|
9
|
-
require "bunny/cruby/ssl_socket"
|
|
3
|
+
require "bunny/cruby/ssl_socket"
|
|
10
4
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
5
|
+
module Bunny
|
|
6
|
+
# An alias for the standard SSLSocket,
|
|
7
|
+
# exists from the days of JRuby support.
|
|
8
|
+
SSLSocketImpl = SSLSocket
|
|
9
|
+
end
|
data/lib/bunny/test_kit.rb
CHANGED
data/lib/bunny/timeout.rb
CHANGED
data/lib/bunny/timestamp.rb
CHANGED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
module Bunny
|
|
5
|
+
# Passed to [Bunny::TopologyRegistry] to filter entities
|
|
6
|
+
# during topology recovery.
|
|
7
|
+
#
|
|
8
|
+
# @abstract Override to implement the filtering functions.
|
|
9
|
+
#
|
|
10
|
+
# @see Bunny::TopologyRegistry
|
|
11
|
+
class TopologyRecoveryFilter
|
|
12
|
+
# Returns a collection of exchanges that should be recovered during topology recovery.
|
|
13
|
+
# @abstract Override to implement exchange filtering
|
|
14
|
+
# @param xs [Array<Bunny::RecordedExchange>]
|
|
15
|
+
# @return [Array<Bunny::RecordedExchange>]
|
|
16
|
+
def filter_exchanges(xs); raise NotImplementedError; end
|
|
17
|
+
|
|
18
|
+
# Returns a collection of queues that should be recovered during topology recovery.
|
|
19
|
+
# @abstract Override to implement queue filtering.
|
|
20
|
+
# @param qs [Array<Bunny::RecordedQueue>]
|
|
21
|
+
# @return [Array<Bunny::RecordedQueue>]
|
|
22
|
+
def filter_queues(qs); raise NotImplementedError; end
|
|
23
|
+
|
|
24
|
+
# Returns a collection of exchange bindings that should be recovered during topology recovery.
|
|
25
|
+
# @abstract Override to implement exchange binding filtering
|
|
26
|
+
# @param bs [Set<Bunny::RecordedExchangeBinding>]
|
|
27
|
+
# @return [Array<Bunny::RecordedExchangeBinding>, Set<Bunny::RecordedExchangeBinding>]
|
|
28
|
+
def filter_exchange_bindings(bs); raise NotImplementedError; end
|
|
29
|
+
|
|
30
|
+
# Returns a collection of queue bindings that should be recovered during topology recovery.
|
|
31
|
+
# @abstract Override to implement queue binding filtering
|
|
32
|
+
# @param bs [Set<Bunny::RecordedQueueBinding>]
|
|
33
|
+
# @return [Array<Bunny::RecordedQueueBinding>, Set<Bunny::RecordedQueueBinding>]
|
|
34
|
+
def filter_queue_bindings(bs); raise NotImplementedError; end
|
|
35
|
+
|
|
36
|
+
# Returns a collection of consumers that should be recovered during topology recovery.
|
|
37
|
+
# @abstract Override to implement consumer filtering
|
|
38
|
+
# @param bs [Array<Bunny::RecordedConsumer>]
|
|
39
|
+
# @return [Array<Bunny::RecordedConsumer>]
|
|
40
|
+
def filter_consumers(bs); raise NotImplementedError; end
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
# A no-op topology recovery filter. All methods return
|
|
44
|
+
# their inputs exactly as they are.
|
|
45
|
+
class DefaultTopologyRecoveryFilter < TopologyRecoveryFilter
|
|
46
|
+
# Returns the input without any filtering.
|
|
47
|
+
# @param xs [Array<Bunny::RecordedExchange>]
|
|
48
|
+
# @return [Array<Bunny::RecordedExchange>]
|
|
49
|
+
def filter_exchanges(xs); xs; end
|
|
50
|
+
|
|
51
|
+
# Returns the input without any filtering.
|
|
52
|
+
# @param qs [Array<Bunny::RecordedQueue>]
|
|
53
|
+
# @return [Array<Bunny::RecordedQueue>]
|
|
54
|
+
def filter_queues(qs); qs; end
|
|
55
|
+
|
|
56
|
+
# Returns the input without any filtering.
|
|
57
|
+
# @param bs [Set<Bunny::RecordedExchangeBinding>]
|
|
58
|
+
# @return [Array<Bunny::RecordedExchangeBinding>, Set<Bunny::RecordedExchangeBinding>]
|
|
59
|
+
def filter_exchange_bindings(bs); bs; end
|
|
60
|
+
|
|
61
|
+
# Returns the input without any filtering.
|
|
62
|
+
# @param bs [Set<Bunny::RecordedQueueBinding>]
|
|
63
|
+
# @return [Array<Bunny::RecordedQueueBinding>, Set<Bunny::RecordedQueueBinding>]
|
|
64
|
+
def filter_queue_bindings(bs); bs; end
|
|
65
|
+
|
|
66
|
+
# Returns the input without any filtering.
|
|
67
|
+
# @param cs [Array<Bunny::RecordedConsumer>]
|
|
68
|
+
# @return [Array<Bunny::RecordedConsumer>]
|
|
69
|
+
def filter_consumers(cs); cs; end
|
|
70
|
+
end
|
|
71
|
+
end
|