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)
Forget about it. I haven't thought it through properly.