2 Replies Latest reply on Nov 11, 2005 11:33 AM by Ovidiu Feodorov


    Ovidiu Feodorov Master

      I think we can get away without adding an isCancelled() method on Delivery and maintaining a "cancelled" state. If the Delivery is cancelled in a race condition before being returned to the channel, then the Receiver just returns null instead returning a "cancelled" delivery.

        • 1. Re: Delivery.isCancelled()
          Tim Fox Master

          I don't know what you mean by "then the Receiver just returns null".

          How can the thread that the cancel comes in on, make the thread that's executing the handle() method suddenly return null, as opposed to the delivery reference?

          Anyway, the delivery can be cancelled *after* the handle() method has returned but before the pertinent core code that checks the state of the delivery has been executed.

          So I think we don't have any choice but to store the cancelled as some kind of state in the delivery.

          Perhaps I just don't understand your suggestion fully?..... Could you elaborate. (Pseudocode would be good)

          • 2. Re: Delivery.isCancelled()
            Ovidiu Feodorov Master

            Forget about it. I haven't thought it through properly.