Debian Codegraph @

ruby/lib/core/tracker.rb

raw
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
20
21 # Track the {Transfer::State} of a sent message.
22 class Tracker < Transfer
23 # @return [Sender] The parent {Sender} link.
24 def sender() link; end
25
26 # Re-delivery modifications sent by the receiver in {Delivery#release}
27 # @return [Hash] See the {Delivery#release} +opts+ parameter.
28 # @return [nil] If no modifications were requested by the receiver.
29 def modifications()
30 return nil if (state != MODIFIED)
31 d = Cproton.pn_delivery_remote(@impl)
32 {
33 :failed => Cproton.pn_disposition_is_failed(d),
34 :undeliverable => Cproton.pn_disposition_is_undeliverable(d),
35 :annotations => Codec::Data.to_object(Cproton.pn_disposition_annotations(d))
36 }
37 end
38
39 # Abort a partially-sent message.
40 # The tracker can no longer be used after calling {#abort}.
41 def abort()
42 Cproton.pn_delivery_abort(@impl)
43 end
44 end
45 end