qpid_proton 0.21.0 → 0.22.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.
@@ -1,36 +0,0 @@
1
- # Licensed to the Apache Software Foundation (ASF) under one
2
- # or more contributor license agreements. See the NOTICE file
3
- # distributed with this work for additional information
4
- # regarding copyright ownership. The ASF licenses this file
5
- # to you under the Apache License, Version 2.0 (the
6
- # "License"); you may not use this file except in compliance
7
- # with the License. You may obtain a copy of the License at
8
- #
9
- # http://www.apache.org/licenses/LICENSE-2.0
10
- #
11
- # Unless required by applicable law or agreed to in writing,
12
- # software distributed under the License is distributed on an
13
- # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
- # KIND, either express or implied. See the License for the
15
- # specific language governing permissions and limitations
16
- # under the License.
17
-
18
-
19
- module Qpid::Proton::Messenger
20
-
21
- # A +Subscription+ is an opaque object for working with a +Messenger+'s
22
- # subscriptions.
23
- #
24
- class Subscription
25
-
26
- def initialize(impl) # :nodoc:
27
- @impl = impl
28
- end
29
-
30
- def impl # :nodoc:
31
- @impl
32
- end
33
-
34
- end
35
-
36
- end
@@ -1,37 +0,0 @@
1
- # Licensed to the Apache Software Foundation (ASF) under one
2
- # or more contributor license agreements. See the NOTICE file
3
- # distributed with this work for additional information
4
- # regarding copyright ownership. The ASF licenses this file
5
- # to you under the Apache License, Version 2.0 (the
6
- # "License"); you may not use this file except in compliance
7
- # with the License. You may obtain a copy of the License at
8
- #
9
- # http://www.apache.org/licenses/LICENSE-2.0
10
- #
11
- # Unless required by applicable law or agreed to in writing,
12
- # software distributed under the License is distributed on an
13
- # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
- # KIND, either express or implied. See the License for the
15
- # specific language governing permissions and limitations
16
- # under the License.
17
-
18
-
19
- module Qpid::Proton::Messenger
20
-
21
- # A +Tracker+ is used to track the disposition of a +Message+.
22
- #
23
- class Tracker
24
-
25
- CUMULATIVE = Cproton::PN_CUMULATIVE
26
-
27
- def initialize(impl) # :nodoc:
28
- @impl = impl
29
- end
30
-
31
- def impl # :nodoc:
32
- @impl
33
- end
34
-
35
- end
36
-
37
- end
@@ -1,68 +0,0 @@
1
- # Licensed to the Apache Software Foundation (ASF) under one
2
- # or more contributor license agreements. See the NOTICE file
3
- # distributed with this work for additional information
4
- # regarding copyright ownership. The ASF licenses this file
5
- # to you under the Apache License, Version 2.0 (the
6
- # "License"); you may not use this file except in compliance
7
- # with the License. You may obtain a copy of the License at
8
- #
9
- # http://www.apache.org/licenses/LICENSE-2.0
10
- #
11
- # Unless required by applicable law or agreed to in writing,
12
- # software distributed under the License is distributed on an
13
- # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
- # KIND, either express or implied. See the License for the
15
- # specific language governing permissions and limitations
16
- # under the License.
17
-
18
-
19
- module Qpid::Proton::Messenger
20
-
21
- # TrackerStatus contains symbols that represent the status value for a
22
- # Tracker.
23
- #
24
- class TrackerStatus
25
-
26
- def initialize value, name # :nodoc:
27
- @value = value
28
- @name = name
29
- end
30
-
31
- def value # :nodoc:
32
- @value
33
- end
34
-
35
- def to_s # :nodoc:
36
- @name.to_s
37
- end
38
-
39
- def self.by_name(name) # :nodoc:
40
- @by_name[name.to_sym] unless name.nil?
41
- end
42
-
43
- def self.by_value(value) # :nodoc:
44
- @by_value[value] unless value.nil?
45
- end
46
-
47
- private
48
-
49
- def self.add_item(key, value) # :nodoc:
50
- @by_name ||= {}
51
- @by_name[key] = TrackerStatus.new value, key
52
- @by_value ||= {}
53
- @by_value[value] = @by_name[key]
54
- end
55
-
56
- def self.const_missing(key) # :nodoc:
57
- @by_name[key]
58
- end
59
-
60
- self.add_item :UNKNOWN, Cproton::PN_STATUS_UNKNOWN
61
- self.add_item :PENDING, Cproton::PN_STATUS_PENDING
62
- self.add_item :ACCEPTED, Cproton::PN_STATUS_ACCEPTED
63
- self.add_item :REJECTED, Cproton::PN_STATUS_REJECTED
64
- self.add_item :SETTLED, Cproton::PN_STATUS_SETTLED
65
-
66
- end
67
-
68
- end
data/lib/util/timeout.rb DELETED
@@ -1,49 +0,0 @@
1
- # Licensed to the Apache Software Foundation (ASF) under one
2
- # or more contributor license agreements. See the NOTICE file
3
- # distributed with this work for additional information
4
- # regarding copyright ownership. The ASF licenses this file
5
- # to you under the Apache License, Version 2.0 (the
6
- # "License"); you may not use this file except in compliance
7
- # with the License. You may obtain a copy of the License at
8
- #
9
- # http://www.apache.org/licenses/LICENSE-2.0
10
- #
11
- # Unless required by applicable law or agreed to in writing,
12
- # software distributed under the License is distributed on an
13
- # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
- # KIND, either express or implied. See the License for the
15
- # specific language governing permissions and limitations
16
- # under the License.
17
-
18
-
19
- module Qpid::Proton::Util
20
-
21
- # Provides methods for converting between milliseconds, seconds
22
- # and timeout values.
23
- #
24
- # @private
25
- module Timeout
26
-
27
- def sec_to_millis(s)
28
- return (s * 1000).to_int
29
- end
30
-
31
- def millis_to_sec(ms)
32
- return (ms.to_f / 1000.0).to_int
33
- end
34
-
35
- def timeout_to_millis(s)
36
- return Cproton::PN_MILLIS_MAX if s.nil?
37
-
38
- return sec_to_millis(s)
39
- end
40
-
41
- def millis_to_timeout(ms)
42
- return nil if ms == Cproton::PN_MILLIS_MAX
43
-
44
- return millis_to_sec(ms)
45
- end
46
-
47
- end
48
-
49
- end
@@ -1,23 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require 'qpid_proton.rb'
4
-
5
- messenger = Qpid::Proton::Messenger::Messenger.new()
6
- messenger.incoming_window = 1
7
- message = Qpid::Proton::Message.new()
8
-
9
- address = ARGV[0]
10
- if not address then
11
- address = "~0.0.0.0"
12
- end
13
- messenger.subscribe(address)
14
-
15
- messenger.start()
16
-
17
- puts "Listening"; STDOUT.flush
18
- messenger.receive()
19
- messenger.get(message)
20
- puts "Got: #{message.body}"
21
- messenger.accept()
22
-
23
- messenger.stop()
@@ -1,21 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require 'qpid_proton.rb'
4
-
5
- messenger = Qpid::Proton::Messenger::Messenger.new()
6
- messenger.outgoing_window = 10
7
- message = Qpid::Proton::Message.new()
8
-
9
- address = ARGV[0]
10
- if not address then
11
- address = "0.0.0.0"
12
- end
13
-
14
- message.address = address
15
- message.body = "Hello World!"
16
-
17
- messenger.start()
18
- tracker = messenger.put(message)
19
- messenger.send()
20
- print "Status: ", messenger.status(tracker), "\n"
21
- messenger.stop()